diff options
| author | Gautham Goli | 2017-01-18 15:55:32 +0530 |
|---|---|---|
| committer | Gautham Goli | 2017-01-18 22:35:37 +0530 |
| commit | 0b3d9031e26b47d0ebf48276616c1c4da01ce336 (patch) | |
| tree | da960b9e98800b0fce051aaa21811124dbaac3c4 /Library/Homebrew/dev-cmd | |
| parent | 483c40fb03b83d109795ece1351dcc1ca318a143 (diff) | |
| download | brew-0b3d9031e26b47d0ebf48276616c1c4da01ce336.tar.bz2 | |
Add --fix option to brew audit command
Diffstat (limited to 'Library/Homebrew/dev-cmd')
| -rw-r--r-- | Library/Homebrew/dev-cmd/audit.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 88d9a535c..c2d6aeaed 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -1,11 +1,14 @@ -#: * `audit` [`--strict`] [`--online`] [`--new-formula`] [`--display-cop-names`] [`--display-filename`] [<formulae>]: +#: * `audit` [`--strict`] [`--fix`] [`--online`] [`--new-formula`] [`--display-cop-names`] [`--display-filename`] [<formulae>]: #: Check <formulae> for Homebrew coding style violations. This should be #: run before submitting a new formula. #: #: If no <formulae> are provided, all of them are checked. #: #: If `--strict` is passed, additional checks are run, including RuboCop -#: style checks. +#: style checks and custom cop checks. +#: +#: If `--fix` is passed, style violations and custom cop violations will be +#: automatically fixed using RuboCop's `--auto-correct` feature. #: #: If `--online` is passed, additional slower checks that require a network #: connection are run. @@ -62,8 +65,9 @@ module Homebrew end if strict + options = { fix: ARGV.flag?("--fix"), realpath: true } # Check style in a single batch run up front for performance - style_results = check_style_json(files, realpath: true) + style_results = check_style_json(files, options) end ff.each do |f| |
