aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dev-cmd/audit.rb
diff options
context:
space:
mode:
authorGautham Goli2017-07-15 13:34:16 +0530
committerGautham Goli2017-07-15 17:35:10 +0530
commita8f1b02be936f31d6beedbafae38b063f9085486 (patch)
tree6c223401e0ba45fca1b624ddc992a4cfcdc9a7a2 /Library/Homebrew/dev-cmd/audit.rb
parent83f61830f6346e2a08358a4ca5381b5ffac4fc6e (diff)
downloadbrew-a8f1b02be936f31d6beedbafae38b063f9085486.tar.bz2
audit: Port audit_options rules for new formulae to rubocop and add test
Diffstat (limited to 'Library/Homebrew/dev-cmd/audit.rb')
-rw-r--r--Library/Homebrew/dev-cmd/audit.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index e144fc35c..4bcfdd128 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -87,10 +87,14 @@ module Homebrew
if !only_cops.empty?
options[:only_cops] = only_cops
ARGV.push("--only=style")
+ elsif new_formula
+ options[:only_cops] = [:FormulaAudit, :FormulaAuditStrict, :NewFormulaAudit]
+ elsif strict
+ options[:only_cops] = [:FormulaAudit, :FormulaAuditStrict]
elsif !except_cops.empty?
options[:except_cops] = except_cops
elsif !strict
- options[:except_cops] = [:FormulaAuditStrict]
+ options[:except_cops] = [:FormulaAuditStrict, :NewFormulaAudit]
end
# Check style in a single batch run up front for performance
@@ -553,13 +557,6 @@ class FormulaAuditor
problem "keg_only reason should not end with a period."
end
- def audit_options
- return unless @new_formula
- return if formula.deprecated_options.empty?
- return if formula.versioned_formula?
- problem "New formulae should not use `deprecated_option`."
- end
-
def audit_homepage
homepage = formula.homepage