lib/fasterer/file_traverser.rb in fasterer-0.4.2 vs lib/fasterer/file_traverser.rb in fasterer-0.5.0

- old
+ new

@@ -78,17 +78,17 @@ def root_dir @root_dir ||= Pathname('.') end def output(analyzer) - puts analyzer.file_path.colorize(:red) - offenses_grouped_by_type(analyzer).each do |error_group_name, error_occurences| - puts "#{Fasterer::Offense::EXPLANATIONS[error_group_name]}."\ - " Occurred at lines: #{error_occurences.map(&:line_number).join(', ')}." + error_occurences.map(&:line_number).each do |line| + file_and_line = "#{analyzer.file_path}:#{line}" + print "#{file_and_line.colorize(:red)} #{Fasterer::Offense::EXPLANATIONS[error_group_name]}.\n" + end end - puts + print "\n" end def offenses_grouped_by_type(analyzer) analyzer.errors.group_by(&:name).delete_if do |offense_name, _| ignored_speedups.include?(offense_name)