Permalink
Browse files

added a report summary

  • Loading branch information...
1 parent 7f7a09b commit 48e2b5309e78d876c8bd670e21f23243bfda03d8 @bbatsov committed May 17, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/rubocop/cli.rb
View
@@ -20,6 +20,7 @@ def run
end.parse!
cops = Cop::Cop.all
+ total_offences = 0
target_files.each do |file|
report = Report.create(file)
@@ -30,12 +31,15 @@ def run
cops.each do |cop_klass|
cop = cop_klass.new
cop.inspect(file, source, tokens, sexp)
+ total_offences += cop.offences.count
report << cop if cop.has_report?
end
report.display unless report.empty?
end
+ puts "\n#{target_files.count} files inspected, #{total_offences} offences detected"
+
return 0
end

0 comments on commit 48e2b53

Please sign in to comment.