diff options
Diffstat (limited to 'Library/Homebrew/rubocops')
| -rw-r--r-- | Library/Homebrew/rubocops/extend/formula_cop.rb | 3 | ||||
| -rw-r--r-- | Library/Homebrew/rubocops/lines_cop.rb | 20 |
2 files changed, 22 insertions, 1 deletions
diff --git a/Library/Homebrew/rubocops/extend/formula_cop.rb b/Library/Homebrew/rubocops/extend/formula_cop.rb index 7165ee354..e42d6ee19 100644 --- a/Library/Homebrew/rubocops/extend/formula_cop.rb +++ b/Library/Homebrew/rubocops/extend/formula_cop.rb @@ -124,7 +124,8 @@ module RuboCop case type when :required - type_match = !node.method_args.nil? && node.method_args.first.str_type? + type_match = !node.method_args.nil? && + (node.method_args.first.str_type? || node.method_args.first.sym_type?) if type_match && !name_match name_match = node_equals?(node.method_args.first, name) end diff --git a/Library/Homebrew/rubocops/lines_cop.rb b/Library/Homebrew/rubocops/lines_cop.rb new file mode 100644 index 000000000..22039869b --- /dev/null +++ b/Library/Homebrew/rubocops/lines_cop.rb @@ -0,0 +1,20 @@ +require_relative "./extend/formula_cop" + +module RuboCop + module Cop + module FormulaAudit + # This cop checks for various miscellaneous Homebrew coding styles + class Lines < FormulaCop + def audit_formula(_node, _class_node, _parent_class_node, _body_node) + [:automake, :autoconf, :libtool].each do |dependency| + next unless depends_on?(dependency) + problem ":#{dependency} is deprecated. Usage should be \"#{dependency}\"" + end + + problem ':apr is deprecated. Usage should be "apr-util"' if depends_on?(:apr) + problem ":tex is deprecated" if depends_on?(:tex) + end + end + end + end +end |
