Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
add ignore_file configuration option
Browse files Browse the repository at this point in the history
  • Loading branch information
Arlantir authored Jan 17, 2022
1 parent 78c5b69 commit fad1cb0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
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

0 comments on commit fad1cb0

Please sign in to comment.