diff --git a/Library/Homebrew/dev-cmd/bump-cask-pr.rb b/Library/Homebrew/dev-cmd/bump-cask-pr.rb index 3d112b0088e589541a316ab35b9ec985fbfdb267..6c9fd09ceebb7816cae4bb704cd2c8f5305caa2f 100644 --- a/Library/Homebrew/dev-cmd/bump-cask-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-cask-pr.rb @@ -27,6 +27,8 @@ module Homebrew "to the cask file." switch "--no-audit", description: "Don't run `brew cask audit` before opening the PR." + switch "--online", + description: "Run `brew cask audit --online` before opening the PR." switch "--no-style", description: "Don't run `brew cask style --fix` before opening the PR." switch "--no-browse", @@ -45,6 +47,7 @@ module Homebrew description: "Ignore duplicate open PRs." conflicts "--dry-run", "--write" + conflicts "--no-audit", "--online" named 1 end end @@ -225,6 +228,8 @@ module Homebrew if args.dry_run? if args.no_audit? ohai "Skipping `brew cask audit`" + elsif args.online? + ohai "brew cask audit --online #{cask.sourcefile_path.basename}" else ohai "brew cask audit #{cask.sourcefile_path.basename}" end @@ -233,6 +238,9 @@ module Homebrew failed_audit = false if args.no_audit? ohai "Skipping `brew cask audit`" + elsif args.online? + system HOMEBREW_BREW_FILE, "cask", "audit", "--online", cask.sourcefile_path + failed_audit = !$CHILD_STATUS.success? else system HOMEBREW_BREW_FILE, "cask", "audit", cask.sourcefile_path failed_audit = !$CHILD_STATUS.success? diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index 3b5a24ca79dbd0e04463eaf4a179d8656a566f7e..f7a796bb89c11b919a1952a3a1245669976af0f4 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -42,6 +42,8 @@ module Homebrew description: "Don't run `brew audit` before opening the PR." switch "--strict", description: "Run `brew audit --strict` before opening the PR." + switch "--online", + description: "Run `brew audit --online` before opening the PR." switch "--no-browse", description: "Print the pull request URL instead of opening in a browser." switch "--no-fork", @@ -71,6 +73,7 @@ module Homebrew conflicts "--dry-run", "--write" conflicts "--no-audit", "--strict" + conflicts "--no-audit", "--online" conflicts "--url", "--tag" max_named 1 end @@ -440,11 +443,14 @@ module Homebrew end def run_audit(formula, alias_rename, old_contents, args:) + audit_args = [] + audit_args << "--strict" if args.strict? + audit_args << "--online" if args.online? if args.dry_run? if args.no_audit? ohai "Skipping `brew audit`" - elsif args.strict? - ohai "brew audit --strict #{formula.path.basename}" + elsif audit_args.present? + ohai "brew audit #{audit_args.join(" ")} #{formula.path.basename}" else ohai "brew audit #{formula.path.basename}" end @@ -454,8 +460,8 @@ module Homebrew failed_audit = false if args.no_audit? ohai "Skipping `brew audit`" - elsif args.strict? - system HOMEBREW_BREW_FILE, "audit", "--strict", formula.path + elsif audit_args.present? + system HOMEBREW_BREW_FILE, "audit", *audit_args, formula.path failed_audit = !$CHILD_STATUS.success? else system HOMEBREW_BREW_FILE, "audit", formula.path diff --git a/docs/Manpage.md b/docs/Manpage.md index c1c0870ebce29e3750a335a917e7eec634c18f7e..6a4757e738e244d613ea6b93e16f89faefd0b86b 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -834,6 +834,8 @@ supplied by the user. When passed with `--write`, generate a new commit after writing changes to the cask file. * `--no-audit`: Don't run `brew cask audit` before opening the PR. +* `--online`: + Run `brew cask audit --online` before opening the PR. * `--no-style`: Don't run `brew cask style --fix` before opening the PR. * `--no-browse`: @@ -880,6 +882,8 @@ nor vice versa. It must use whichever style specification the formula already us Don't run `brew audit` before opening the PR. * `--strict`: Run `brew audit --strict` before opening the PR. +* `--online`: + Run `brew audit --online` before opening the PR. * `--no-browse`: Print the pull request URL instead of opening in a browser. * `--no-fork`: diff --git a/manpages/brew.1 b/manpages/brew.1 index 65c0f144cb469475a649a34982c965e66c462c2a..3f4f9acf5fdc15eb267f85724a41c476cc9ec829 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -1157,6 +1157,10 @@ When passed with \fB\-\-write\fR, generate a new commit after writing changes to Don\'t run \fBbrew cask audit\fR before opening the PR\. . .TP +\fB\-\-online\fR +Run \fBbrew cask audit \-\-online\fR before opening the PR\. +. +.TP \fB\-\-no\-style\fR Don\'t run \fBbrew cask style \-\-fix\fR before opening the PR\. . @@ -1224,6 +1228,10 @@ Don\'t run \fBbrew audit\fR before opening the PR\. Run \fBbrew audit \-\-strict\fR before opening the PR\. . .TP +\fB\-\-online\fR +Run \fBbrew audit \-\-online\fR before opening the PR\. +. +.TP \fB\-\-no\-browse\fR Print the pull request URL instead of opening in a browser\. .