rubocops/cask: Use ON_SYSTEM_METHODS for skipping
Co-authored-by: Rylan Polster <rslpolster@gmail.com>
This commit is contained in:
parent
9cc046bc60
commit
5ce4966f4a
@ -20,7 +20,7 @@ module RuboCop
|
|||||||
# TODO: We probably only want to disallow `version`, `url`, and `sha256` stanzas being overridden?
|
# TODO: We probably only want to disallow `version`, `url`, and `sha256` stanzas being overridden?
|
||||||
next unless RuboCop::Cask::Constants::STANZA_ORDER.include?(stanza.stanza_name)
|
next unless RuboCop::Cask::Constants::STANZA_ORDER.include?(stanza.stanza_name)
|
||||||
# Skip if the stanza we detect is already in an `on_*` block.
|
# Skip if the stanza we detect is already in an `on_*` block.
|
||||||
next if stanza.parent_node.block_type? && stanza.parent_node.method_name.to_s.start_with?("on_")
|
next if stanza.parent_node.block_type? && RuboCop::Cask::Constants::ON_SYSTEM_METHODS.include?(stanza.parent_node.method_name)
|
||||||
|
|
||||||
add_offense(stanza.source_range, message: format(MESSAGE, stanza: stanza.stanza_name))
|
add_offense(stanza.source_range, message: format(MESSAGE, stanza: stanza.stanza_name))
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user