diff --git a/Library/Contributions/examples/brew-audit.rb b/Library/Contributions/examples/brew-audit.rb index 54d53d903b..7b527f59bf 100755 --- a/Library/Contributions/examples/brew-audit.rb +++ b/Library/Contributions/examples/brew-audit.rb @@ -80,7 +80,7 @@ def audit_formula_text text end # No trailing whitespace, please - if text =~ /[ ]+$/ + if text =~ /(\t|[ ])+$/ problems << " * Trailing whitespace was found." end @@ -88,6 +88,12 @@ def audit_formula_text text problems << " * Use \"if ARGV.build_head?\" instead" end + if ARGV.include? "--warn" + if text =~ /^\t/ + problems << " * Use spaces instead of tabs for indentation" + end + end + return problems end diff --git a/Library/Contributions/manpages/brew.1.md b/Library/Contributions/manpages/brew.1.md index d595cc4f8d..5751f7d002 100644 --- a/Library/Contributions/manpages/brew.1.md +++ b/Library/Contributions/manpages/brew.1.md @@ -188,10 +188,13 @@ to recognize `brew cmdname`. Some external commands are shipped with Homebrew, and enabled by default. - * `audit`: + * `audit [--warn]`: Checks all formulae for Homebrew coding style violations. This should be run before submitting a new formula for inclusion. + If `--warn` is passed, performs additional stricter checks that may not need + to be fixed before submitting. + * `options` : Displays install options specific to . diff --git a/share/man/man1/brew.1 b/share/man/man1/brew.1 index ff3e5eee5d..203ec42440 100644 --- a/share/man/man1/brew.1 +++ b/share/man/man1/brew.1 @@ -197,9 +197,12 @@ Homebrew allows external commands to be defined by putting a +x file named \fBbr Some external commands are shipped with Homebrew, and enabled by default\. . .TP -\fBaudit\fR +\fBaudit [\-\-warn]\fR Checks all formulae for Homebrew coding style violations\. This should be run before submitting a new formula for inclusion\. . +.IP +If \fB\-\-warn\fR is passed, performs additional stricter checks that may not need to be fixed before submitting\. +. .TP \fBoptions\fR \fIformula\fR Displays install options specific to \fIformula\fR\.