Merge pull request #8231 from MikeMcQuaid/audit-tap

audit: add --tap argument.
This commit is contained in:
Mike McQuaid 2020-08-06 10:54:14 +01:00 committed by GitHub
commit c761c04e26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 5 deletions

View File

@ -37,6 +37,8 @@ module Homebrew
description: "Run various additional style checks to determine if a new formula is eligible "\
"for Homebrew. This should be used when creating new formula and implies "\
"`--strict` and `--online`."
flag "--tap=",
description: "Check the formulae within the given tap, specified as <user>`/`<repo>."
switch "--fix",
description: "Fix style violations automatically using RuboCop's auto-correct feature."
switch "--display-cop-names",
@ -46,7 +48,7 @@ module Homebrew
"make output easy to grep."
switch "--skip-style",
description: "Skip running non-RuboCop style checks. Useful if you plan on running "\
"`brew style` separately."
"`brew style` separately. Default unless a formula is specified by name"
switch "-D", "--audit-debug",
description: "Enable debugging and profiling of audit methods."
comma_array "--only",
@ -85,12 +87,18 @@ module Homebrew
strict = new_formula || args.strict?
online = new_formula || args.online?
git = args.git?
skip_style = args.skip_style? || args.no_named?
skip_style = args.skip_style? || args.no_named? || args.tap
ENV.activate_extensions!
ENV.setup_build_environment
audit_formulae = args.no_named? ? Formula : args.resolved_formulae
audit_formulae = if args.tap
Tap.fetch(args.tap).formula_names.map { |name| Formula[name] }
elsif args.no_named?
Formula
else
args.resolved_formulae
end
style_files = args.formulae_paths unless skip_style
only_cops = args.only_cops

View File

@ -680,6 +680,8 @@ any errors are found.
Run additional, slower style checks that require a network connection.
* `--new-formula`:
Run various additional style checks to determine if a new formula is eligible for Homebrew. This should be used when creating new formula and implies `--strict` and `--online`.
* `--tap`:
Check the formulae within the given tap, specified as *`user`*`/`*`repo`*.
* `--fix`:
Fix style violations automatically using RuboCop's auto-correct feature.
* `--display-cop-names`:
@ -687,7 +689,7 @@ any errors are found.
* `--display-filename`:
Prefix every line of output with the file or formula name being audited, to make output easy to grep.
* `--skip-style`:
Skip running non-RuboCop style checks. Useful if you plan on running `brew style` separately.
Skip running non-RuboCop style checks. Useful if you plan on running `brew style` separately. Default unless a formula is specified by name
* `-D`, `--audit-debug`:
Enable debugging and profiling of audit methods.
* `--only`:

View File

@ -882,6 +882,10 @@ Run additional, slower style checks that require a network connection\.
Run various additional style checks to determine if a new formula is eligible for Homebrew\. This should be used when creating new formula and implies \fB\-\-strict\fR and \fB\-\-online\fR\.
.
.TP
\fB\-\-tap\fR
Check the formulae within the given tap, specified as \fIuser\fR\fB/\fR\fIrepo\fR\.
.
.TP
\fB\-\-fix\fR
Fix style violations automatically using RuboCop\'s auto\-correct feature\.
.
@ -895,7 +899,7 @@ Prefix every line of output with the file or formula name being audited, to make
.
.TP
\fB\-\-skip\-style\fR
Skip running non\-RuboCop style checks\. Useful if you plan on running \fBbrew style\fR separately\.
Skip running non\-RuboCop style checks\. Useful if you plan on running \fBbrew style\fR separately\. Default unless a formula is specified by name
.
.TP
\fB\-D\fR, \fB\-\-audit\-debug\fR