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)
config.rules.each do |rule|
puts \
"#{rule.name.colorize(:white)} " \
"[#{rule.severity.symbol.to_s.colorize(:green)}] - " \
"#{rule.description.colorize(:dark_gray)}"
puts "%s [%s] - %s" % {
rule.name.colorize(:white),
rule.severity.symbol.to_s.colorize(:green),
rule.description.colorize(:dark_gray),
}
end
exit 0
end

View file

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