Skip to content

Commit

Permalink
use Warning#relative_path for location path when reporting in codecli…
Browse files Browse the repository at this point in the history
…mate 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.
  • Loading branch information
RubyBrewsday committed Nov 15, 2022
1 parent 2101e97 commit cc26ebd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/brakeman/report/report_codeclimate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit cc26ebd

Please sign in to comment.