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

add option ignore_file #31

Merged
merged 1 commit into from
Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,23 @@ Brakeman [Confidence](https://github.com/presidentbeef/brakeman#confidence-level
messages generated by Pronto. High confidence maps to fatal, medium confidence maps to warning, and low confidence maps
to info.

## Run all checks

# Options
Brakeman also includes some optional checks and by setting the following in your `.pronto.yml` you can run every check included in the gem:

## Run all checks

```yaml
brakeman:
run_all_checks: true
```

(This is the equivalent of running `brakeman -A` on the command line.)

## Ignore file

```yaml
brakeman:
ignore_file: '.brakeman'
```

(This is the equivalent of running `brakeman -i IGNOREFILE` on the command line.)
7 changes: 6 additions & 1 deletion lib/pronto/brakeman.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def run
output = ::Brakeman.run(app_path: repo_path,
output_formats: [:to_s],
only_files: files,
run_all_checks: run_all_checks?)
run_all_checks: run_all_checks?,
ignore_file: ignore_file)
messages_for(patches, output).compact
rescue ::Brakeman::NoApplication
[]
Expand Down Expand Up @@ -61,6 +62,10 @@ def run_all_checks?
pronto_brakeman_config['run_all_checks']
end

def ignore_file
pronto_brakeman_config['ignore_file']
end

def pronto_brakeman_config
pronto_brakeman_config ||= Pronto::ConfigFile.new.to_h['brakeman'] || {}
end
Expand Down