Colorize code in rule descriptions too

This commit is contained in:
Sijawusz Pur Rahnama 2023-07-13 03:40:35 +02:00
parent 8ff621ba66
commit bede3f97a1
2 changed files with 6 additions and 2 deletions

View file

@ -244,7 +244,9 @@ module Ameba::Cli
rule.severity.to_s.colorize(rule.severity.color),
rule.enabled? ? ENABLED_MARK : DISABLED_MARK,
}
output_paragraph rule.description
if rule_description = colorize_code_fences(rule.description)
output_paragraph rule_description
end
if rule_doc = colorize_code_fences(rule.class.parsed_doc)
output_title "Detailed description"

View file

@ -62,7 +62,9 @@ module Ameba::Formatter
rule.name.colorize(:magenta),
rule.severity.to_s.colorize(rule.severity.color),
}
output_paragraph rule.description
if rule_description = colorize_code_fences(rule.description)
output_paragraph rule_description
end
rule_doc = colorize_code_fences(rule.class.parsed_doc)
return unless rule_doc