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

audit: add --tap argument. #8231

Merged
merged 1 commit into from
Aug 6, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 11 additions & 3 deletions Library/Homebrew/dev-cmd/audit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def audit_args
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",
Expand All @@ -46,7 +48,7 @@ def audit_args
"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",
Expand Down Expand Up @@ -85,12 +87,18 @@ def audit
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
Expand Down
6 changes: 4 additions & 2 deletions docs/Manpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -674,14 +674,16 @@ 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`:
Include the RuboCop cop name for each violation in the output.
* `--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`:
Expand Down Expand Up @@ -1211,7 +1213,7 @@ flags which will help find keg-only dependencies like `openssl`, `icu4c`, etc.
`install` won't output a `Brewfile.lock.json`.
* `--all`:
`list` all dependencies.
* `--brews`:
* `--formulae`:
`list` Homebrew dependencies.
* `--casks`:
`list` Homebrew Cask dependencies.
Expand Down
8 changes: 6 additions & 2 deletions manpages/brew.1
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,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\.
.
Expand All @@ -883,7 +887,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
Expand Down Expand Up @@ -1569,7 +1573,7 @@ Read the \fBBrewfile\fR from \fB~/\.Brewfile\fR\.
\fBlist\fR all dependencies\.
.
.TP
\fB\-\-brews\fR
\fB\-\-formulae\fR
\fBlist\fR Homebrew dependencies\.
.
.TP
Expand Down