Skip to content

Commit

Permalink
Make output fully green if there are no offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
Volosh1n committed Mar 14, 2020
1 parent aebf173 commit 1c6dc05
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/fasterer/file_traverser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,14 @@ def inspected_files_output
end

def offenses_found_output
color = @offenses_found_count.zero? :green : :red
"#{@offenses_found_count} #{pluralize(@offenses_found_count, 'offense')} detected"
.colorize(:red)
.colorize(color)
end

def unparsable_files_output
return if @unparsable_files_count.zero?

"#{@unparsable_files_count} unparsable #{pluralize(@unparsable_files_count, 'file')} found"
.colorize(:red)
end
Expand Down

0 comments on commit 1c6dc05

Please sign in to comment.