on_macos/on_linux block: allow to use deprecate or disable

This commit is contained in:
Michka Popoff 2020-11-20 22:14:56 +01:00
parent c376837544
commit a044f99d56
2 changed files with 4 additions and 0 deletions

View File

@ -150,6 +150,8 @@ module RuboCop
valid_node ||= child.method_name.to_s == "patch"
valid_node ||= child.method_name.to_s == "resource"
valid_node ||= child.method_name.to_s == "deprecate!"
valid_node ||= child.method_name.to_s == "disable!"
@offensive_node = on_os_block
@offense_source_range = on_os_block.source_range

View File

@ -324,6 +324,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do
homepage "https://brew.sh"
on_macos do
disable! because: :does_not_build
depends_on "readline"
end
@ -341,6 +342,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do
homepage "https://brew.sh"
on_linux do
deprecate! because: "it's deprecated"
depends_on "readline"
end