aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorLee Hanxue2013-11-20 00:00:36 +0800
committerMisty De Meo2014-04-06 10:30:36 -0700
commit7398b7278370900fcfbd2e468ed49ea965a191c9 (patch)
tree92c44ff0da60708ee033b9f9aae74c9cdd1420e0 /Library
parent6a866d64ce9174092fafcd2c0045babc22cee455 (diff)
downloadhomebrew-7398b7278370900fcfbd2e468ed49ea965a191c9.tar.bz2
brew audit: show line number for whitespace
Closes #24481. Closes #24490.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/audit.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index 509cef830..9f86577be 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -332,7 +332,7 @@ class FormulaAuditor
end
end
- def audit_line(line)
+ def audit_line(line, lineno)
if line =~ /<(Formula|AmazonWebServicesFormula|ScriptFileFormula|GithubGistFormula)/
problem "Use a space in class inheritance: class Foo < #{$1}"
end
@@ -410,7 +410,7 @@ class FormulaAuditor
# No trailing whitespace, please
if line =~ /[\t ]+$/
- problem "Trailing whitespace was found"
+ problem "#{lineno}: Trailing whitespace was found"
end
if line =~ /if\s+ARGV\.include\?\s+'--(HEAD|devel)'/
@@ -568,7 +568,7 @@ class FormulaAuditor
audit_conflicts
audit_patches
audit_text
- text.each_line { |line| audit_line(line) }
+ text.split("\n").each_with_index { |line, lineno| audit_line(line, lineno) }
audit_installed
end