diff options
| author | Adam Vandenberg | 2010-10-21 07:51:47 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2010-10-21 07:53:37 -0700 |
| commit | 405613a0ef9d725b847c3d2228ef8b0d984de251 (patch) | |
| tree | 764a405dbefdf79b1d676901d0a8c3b250b2f038 /Library/Contributions/examples | |
| parent | b82be5c8b0d3482da165d6ee8bbd0ddfce547695 (diff) | |
| download | brew-405613a0ef9d725b847c3d2228ef8b0d984de251.tar.bz2 | |
brew-audit - add check for tabs.
Add a new mode "brew audit --warn" that performs stricter checks
that might not need to be fixed.
Currently this includes a check for using tabs instead of spaces
for indentation; Homebrew style is "2-space indentation."
Documented this new switch.
Diffstat (limited to 'Library/Contributions/examples')
| -rwxr-xr-x | Library/Contributions/examples/brew-audit.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Library/Contributions/examples/brew-audit.rb b/Library/Contributions/examples/brew-audit.rb index 54d53d903..7b527f59b 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 |
