Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use relative paths for __FILE__ #1347

Merged
merged 1 commit into from Apr 18, 2019

Conversation

Projects
None yet
2 participants
@presidentbeef
Copy link
Owner

commented Apr 18, 2019

RubyParser converts __FILE__ to the actual file name at parse time. Brakeman was passing in the full absolute path to use for that file name. That would cause fingerprints of warnings involving __FILE__ to change based on where the code happened to be when it was scanned.

Instead, changed to passing in a relative file path for better fingerprint stability.

This also affects parse error messages.

@presidentbeef presidentbeef merged commit f834965 into master Apr 18, 2019

10 checks passed

ci/circleci: default Your tests passed on CircleCI!
Details
ci/circleci: test-2-3 Your tests passed on CircleCI!
Details
ci/circleci: test-2-4 Your tests passed on CircleCI!
Details
ci/circleci: test-2-5 Your tests passed on CircleCI!
Details
ci/circleci: test-2-6 Your tests passed on CircleCI!
Details
ci/circleci: test-jruby Your tests passed on CircleCI!
Details
ci/circleci: upload-coverage Your tests passed on CircleCI!
Details
codeclimate All good!
Details
codeclimate/diff-coverage 100% (90% threshold)
Details
codeclimate/total-coverage 95% (0.0% change)
Details

@presidentbeef presidentbeef deleted the use_relative_paths_for_FILE_ branch Apr 19, 2019

@@ -13,7 +13,7 @@ def expected
:controller => 0,
:model => 0,
:template => 5,
:generic => 16
:generic => 17

This comment has been minimized.

Copy link
@qsphan

qsphan Apr 30, 2019

Why is it changed to 17?

This comment has been minimized.

Copy link
@presidentbeef

presidentbeef Apr 30, 2019

Author Owner

These numbers indicate how many issues are in the test suite. Since this change added a test case, the expected number of issues increased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.