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 diff --git a/test/tests/report_generation.rb b/test/tests/report_generation.rb index 402701d24c..3aff3dfb6e 100644 --- a/test/tests/report_generation.rb +++ b/test/tests/report_generation.rb @@ -37,6 +37,7 @@ def test_codeclimate_sanity report = @@report.to_codeclimate assert report.is_a? String + refute report.include? Dir.pwd # Ensure output does not include absolute paths end def test_csv_sanity