Refactor usages of \ to sth more readable if possible

This commit is contained in:
Sijawusz Pur Rahnama 2022-11-23 05:36:10 +01:00
parent 38eb5d5e50
commit 735ec2462a
2 changed files with 10 additions and 8 deletions

View file

@ -184,10 +184,11 @@ module Ameba::Cli
private def print_rules(config) private def print_rules(config)
config.rules.each do |rule| config.rules.each do |rule|
puts \ puts "%s [%s] - %s" % {
"#{rule.name.colorize(:white)} " \ rule.name.colorize(:white),
"[#{rule.severity.symbol.to_s.colorize(:green)}] - " \ rule.severity.symbol.to_s.colorize(:green),
"#{rule.description.colorize(:dark_gray)}" rule.description.colorize(:dark_gray),
}
end end
exit 0 exit 0
end end

View file

@ -45,10 +45,11 @@ module Ameba::Formatter
end end
end end
output.puts output.puts
output.puts \ output.puts ("[%s] %s: %s" % {
"[#{issue.rule.severity.symbol}] " \ issue.rule.severity.symbol,
"#{issue.rule.name}: " \ issue.rule.name,
"#{issue.message}".colorize(:red) issue.message,
}).colorize(:red)
if show_affected_code && (code = affected_code(issue)) if show_affected_code && (code = affected_code(issue))
output << code.colorize(:default) output << code.colorize(:default)