Skip to content

Commit

Permalink
Merge pull request #17035 from cho-m/resource_requires_dependencies-a…
Browse files Browse the repository at this point in the history
…void-stacktrace

rubocops/resource_requires_dependencies: check `sym_type?`
  • Loading branch information
MikeMcQuaid committed Apr 5, 2024
2 parents ad196e0 + 747e95b commit dcf80b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Library/Homebrew/rubocops/resource_requires_dependencies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
uses_from_macos_or_depends_on = (uses_from_macos_nodes + depends_on_nodes).filter_map do |node|
if (dep = node.arguments.first).hash_type?
dep_types = dep.values.first
dep_types = dep_types.array_type? ? dep_types.values.map(&:value) : [dep_types.value]
dep.keys.first.str_content if dep_types.include?(:build)
dep_types = dep_types.array_type? ? dep_types.values : [dep_types]
dep.keys.first.str_content if dep_types.select(&:sym_type?).map(&:value).include?(:build)
else
dep.str_content
end
Expand Down

0 comments on commit dcf80b6

Please sign in to comment.