diff --git a/rdjson_formatter/rdjson_formatter.rb b/rdjson_formatter/rdjson_formatter.rb index 630e608..2026a5d 100644 --- a/rdjson_formatter/rdjson_formatter.rb +++ b/rdjson_formatter/rdjson_formatter.rb @@ -16,6 +16,8 @@ def started(_target_files) def file_finished(file, offenses) offenses.each do |offense| + next if offense.location == RuboCop::Cop::Offense::NO_LOCATION + @rdjson[:diagnostics] << build_diagnostic(file, offense) end end