From cc26ebdc230a8acc7a4c758e9f8948f86d0ca12d Mon Sep 17 00:00:00 2001 From: Mike Poage Date: Tue, 15 Nov 2022 11:51:03 -0500 Subject: [PATCH] use Warning#relative_path for location path when reporting in codeclimate format * Since Warning#file could return a reference to the abolute path, and codeclimate does not support reporting issues in that format, we want to always ensure that the location of any issue is being reported with a relative location. --- lib/brakeman/report/report_codeclimate.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/brakeman/report/report_codeclimate.rb b/lib/brakeman/report/report_codeclimate.rb index 6c1d6f9278..2cfb0fcd38 100644 --- a/lib/brakeman/report/report_codeclimate.rb +++ b/lib/brakeman/report/report_codeclimate.rb @@ -73,7 +73,7 @@ def file_path(warning) if tracker.options[:path_prefix] (Pathname.new(tracker.options[:path_prefix]) + Pathname.new(warning.file.relative)).to_s else - warning.file + warning.relative_path end end end