aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Homebrew/cmd/audit.rb26
1 files changed, 21 insertions, 5 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index 1a81a55d1..dfc8f17c4 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -435,16 +435,32 @@ class FormulaAuditor
problem "Use 'build.head?' instead of inspecting 'version'"
end
- if line =~ /build\.include\?\s+['"]\-\-(.*)['"]/
+ if line =~ /build\.include\?[\s\(]+['"]\-\-(.*)['"]/
problem "Reference '#{$1}' without dashes"
end
- if line =~ /build\.with\?\s+['"]-?-?with-(.*)['"]/
- problem "No double 'with': Use `build.with? '#{$1}'` to check for \"--with-#{$1}\""
+ if line =~ /build\.include\?[\s\(]+['"]with(out)?-(.*)['"]/
+ problem "Use build.with#{$1}? \"#{$2}\" instead of build.include? 'with#{$1}-#{$2}'"
end
- if line =~ /build\.without\?\s+['"]-?-?without-(.*)['"]/
- problem "No double 'without': Use `build.without? '#{$1}'` to check for \"--without-#{$1}\""
+ if line =~ /build\.with\?[\s\(]+['"]-?-?with-(.*)['"]/
+ problem "Don't duplicate 'with': Use `build.with? \"#{$1}\"` to check for \"--with-#{$1}\""
+ end
+
+ if line =~ /build\.without\?[\s\(]+['"]-?-?without-(.*)['"]/
+ problem "Don't duplicate 'without': Use `build.without? \"#{$1}\"` to check for \"--without-#{$1}\""
+ end
+
+ if line =~ /unless build\.with(out)?\?/
+ problem "Don't use unless with 'build.with#{$1}': use 'if build.with#{$1}?'"
+ end
+
+ if line =~ /(not\s|!)\s*build\.with?\?/
+ problem "Don't negate 'build.without?': use 'build.with?'"
+ end
+
+ if line =~ /(not\s|!)\s*build\.without?\?/
+ problem "Don't negate 'build.with?': use 'build.without?'"
end
if line =~ /ARGV\.(?!(debug\?|verbose\?|value[\(\s]))/