bump-formula-pr: run audit by default

This commit is contained in:
commitay 2018-10-28 01:13:50 +10:00
parent 2b3f855083
commit 32b1f13bd0
3 changed files with 16 additions and 12 deletions

View File

@ -1,4 +1,4 @@
#: * `bump-formula-pr` [`--devel`] [`--dry-run` [`--write`]] [`--audit`|`--strict`] [`--no-browse] [`--mirror=`<URL>] [`--version=`<version>] [`--message=`<message>] (`--url=`<URL> `--sha256=`<SHA-256>|`--tag=`<tag> `--revision=`<revision>) [<formula>]: #: * `bump-formula-pr` [`--devel`] [`--dry-run` [`--write`]] [`--no-audit`|`--strict`] [`--no-browse] [`--mirror=`<URL>] [`--version=`<version>] [`--message=`<message>] (`--url=`<URL> `--sha256=`<SHA-256>|`--tag=`<tag> `--revision=`<revision>) [<formula>]:
#: Create a pull request to update a formula with a new URL or a new tag. #: Create a pull request to update a formula with a new URL or a new tag.
#: #:
#: If a <URL> is specified, the <SHA-256> checksum of the new download should #: If a <URL> is specified, the <SHA-256> checksum of the new download should
@ -16,7 +16,7 @@
#: If `--write` is passed along with `--dry-run`, perform a not-so-dry run by #: If `--write` is passed along with `--dry-run`, perform a not-so-dry run by
#: making the expected file modifications but not taking any Git actions. #: making the expected file modifications but not taking any Git actions.
#: #:
#: If `--audit` is passed, run `brew audit` before opening the PR. #: If `--no-audit` is passed, don't run `brew audit` before opening the PR.
#: #:
#: If `--strict` is passed, run `brew audit --strict` before opening the PR. #: If `--strict` is passed, run `brew audit --strict` before opening the PR.
#: #:
@ -74,8 +74,8 @@ module Homebrew
depends_on: "--dry-run", depends_on: "--dry-run",
description: "When passed along with `--dry-run`, perform a not-so-dry run by making the expected "\ description: "When passed along with `--dry-run`, perform a not-so-dry run by making the expected "\
"file modifications but not taking any Git actions." "file modifications but not taking any Git actions."
switch "--audit", switch "--no-audit",
description: "Run `brew audit` before opening the PR." description: "Don't run `brew audit` before opening the PR."
switch "--strict", switch "--strict",
description: "Run `brew audit --strict` before opening the PR." description: "Run `brew audit --strict` before opening the PR."
switch "--no-browse", switch "--no-browse",
@ -320,17 +320,21 @@ module Homebrew
end end
if args.dry_run? if args.dry_run?
if args.strict? if args.no_audit?
ohai "Skipping `brew audit`"
elsif args.strict?
ohai "brew audit --strict #{formula.path.basename}" ohai "brew audit --strict #{formula.path.basename}"
elsif args.audit? else
ohai "brew audit #{formula.path.basename}" ohai "brew audit #{formula.path.basename}"
end end
else else
failed_audit = false failed_audit = false
if args.strict? if args.no_audit?
ohai "Skipping `brew audit`"
elsif args.strict?
system HOMEBREW_BREW_FILE, "audit", "--strict", formula.path system HOMEBREW_BREW_FILE, "audit", "--strict", formula.path
failed_audit = !$CHILD_STATUS.success? failed_audit = !$CHILD_STATUS.success?
elsif args.audit? else
system HOMEBREW_BREW_FILE, "audit", formula.path system HOMEBREW_BREW_FILE, "audit", formula.path
failed_audit = !$CHILD_STATUS.success? failed_audit = !$CHILD_STATUS.success?
end end

View File

@ -759,8 +759,8 @@ formula already uses.
Print what would be done rather than doing it. Print what would be done rather than doing it.
* `--write`: * `--write`:
When passed along with `--dry-run`, perform a not-so-dry run by making the expected file modifications but not taking any Git actions. When passed along with `--dry-run`, perform a not-so-dry run by making the expected file modifications but not taking any Git actions.
* `--audit`: * `--no-audit`:
Run `brew audit` before opening the PR. Don't run `brew audit` before opening the PR.
* `--strict`: * `--strict`:
Run `brew audit --strict` before opening the PR. Run `brew audit --strict` before opening the PR.
* `--no-browse`: * `--no-browse`:

View File

@ -807,8 +807,8 @@ Print what would be done rather than doing it\.
When passed along with \fB\-\-dry\-run\fR, perform a not\-so\-dry run by making the expected file modifications but not taking any Git actions\. When passed along with \fB\-\-dry\-run\fR, perform a not\-so\-dry run by making the expected file modifications but not taking any Git actions\.
. .
.TP .TP
\fB\-\-audit\fR \fB\-\-no\-audit\fR
Run \fBbrew audit\fR before opening the PR\. Don\'t run \fBbrew audit\fR before opening the PR\.
. .
.TP .TP
\fB\-\-strict\fR \fB\-\-strict\fR