From d2f8c3b828b79c4814e1f6a8d0d581fa72ed9c64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mindaugas=20Moz=C5=ABras?= Date: Sun, 6 Sep 2015 22:08:45 +0300 Subject: [PATCH] Explicitly reject offenses disabled by rubocop:disable comment Fixes #13 --- lib/pronto/rubocop.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pronto/rubocop.rb b/lib/pronto/rubocop.rb index ea6dfdd..aaa8db7 100644 --- a/lib/pronto/rubocop.rb +++ b/lib/pronto/rubocop.rb @@ -24,7 +24,7 @@ def inspect(patch) processed_source = ::RuboCop::ProcessedSource.from_file(patch.new_file_full_path.to_s) offences = @inspector.send(:inspect_file, processed_source).first - offences.map do |offence| + offences.sort.reject(&:disabled?).map do |offence| patch.added_lines.select { |line| line.new_lineno == offence.line } .map { |line| new_message(offence, line) } end