diff options
| author | Markus Reiter | 2017-10-07 00:31:28 +0200 |
|---|---|---|
| committer | Markus Reiter | 2017-10-08 16:10:37 +0200 |
| commit | 175ca909ee1a5b57aa0cae2c879920511f311b14 (patch) | |
| tree | 067464b4c08f4c16ca3439b533f06669a78c370c /Library/Homebrew/dev-cmd/audit.rb | |
| parent | 91ab116ace7f4f97d3440190463c93be9ec6d675 (diff) | |
| download | brew-175ca909ee1a5b57aa0cae2c879920511f311b14.tar.bz2 | |
Clean up code style and remove `.rubocop_todo.yml`.
Diffstat (limited to 'Library/Homebrew/dev-cmd/audit.rb')
| -rw-r--r-- | Library/Homebrew/dev-cmd/audit.rb | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 16ae7cba1..6afd1f802 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -53,7 +53,7 @@ module Homebrew module_function def audit - Homebrew.inject_dump_stats!(FormulaAuditor, /^audit_/) if ARGV.switch? "D" + inject_dump_stats!(FormulaAuditor, /^audit_/) if ARGV.switch? "D" Homebrew.auditing = true formula_count = 0 @@ -387,8 +387,10 @@ class FormulaAuditor end end - # core aliases + tap alias names + tap alias full name - @@aliases ||= Formula.aliases + Formula.tap_aliases + def self.aliases + # core aliases + tap alias names + tap alias full name + @aliases ||= Formula.aliases + Formula.tap_aliases + end def audit_formula_name return unless @strict @@ -442,7 +444,7 @@ class FormulaAuditor problem "Dependency '#{dep.name}' was renamed; use new name '#{dep_f.name}'." end - if @@aliases.include?(dep.name) && + if self.class.aliases.include?(dep.name) && (dep_f.core_formula? || !dep_f.versioned_formula?) problem "Dependency '#{dep.name}' is an alias; use the canonical name '#{dep.to_formula.full_name}'." end @@ -453,16 +455,16 @@ class FormulaAuditor problem "Dependency '#{dep.name}' may be unnecessary as it is provided by macOS; try to build this formula without it." end - dep.options.reject do |opt| - next true if dep_f.option_defined?(opt) - dep_f.requirements.detect do |r| + dep.options.each do |opt| + next if dep_f.option_defined?(opt) + next if dep_f.requirements.detect do |r| if r.recommended? opt.name == "with-#{r.name}" elsif r.optional? opt.name == "without-#{r.name}" end end - end.each do |opt| + problem "Dependency #{dep} does not define option #{opt.name.inspect}" end |
