diff --git a/Library/.rubocop.yml b/Library/.rubocop.yml index fe568c15a8..2e8acc8a0d 100644 --- a/Library/.rubocop.yml +++ b/Library/.rubocop.yml @@ -323,11 +323,6 @@ Lint/DuplicateBranch: - "/**/{Formula,Casks}/*.rb" - "**/{Formula,Casks}/*.rb" -# useful for metaprogramming in RSpec -Lint/ConstantDefinitionInBlock: - Exclude: - - "**/*_spec.rb" - # so many of these in formulae and can't be autocorrected Lint/ParenthesesAsGroupedExpression: Exclude: diff --git a/Library/Homebrew/test/exceptions_spec.rb b/Library/Homebrew/test/exceptions_spec.rb index 6c6a39ddc3..ec721ab110 100644 --- a/Library/Homebrew/test/exceptions_spec.rb +++ b/Library/Homebrew/test/exceptions_spec.rb @@ -90,11 +90,11 @@ describe "Exception" do let(:mod) do Module.new do # These are defined within an anonymous module to avoid polluting the global namespace. - # rubocop:disable RSpec/LeakyConstantDeclaration + # rubocop:disable RSpec/LeakyConstantDeclaration,Lint/ConstantDefinitionInBlock class Bar < Requirement; end class Baz < Formula; end - # rubocop:enable RSpec/LeakyConstantDeclaration + # rubocop:enable RSpec/LeakyConstantDeclaration,Lint/ConstantDefinitionInBlock end end diff --git a/Library/Homebrew/test/patching_spec.rb b/Library/Homebrew/test/patching_spec.rb index 830601d1a3..28bb80019d 100644 --- a/Library/Homebrew/test/patching_spec.rb +++ b/Library/Homebrew/test/patching_spec.rb @@ -7,7 +7,7 @@ describe "patching" do let(:formula_subclass) { Class.new(Formula) { # These are defined within an anonymous class to avoid polluting the global namespace. - # rubocop:disable RSpec/LeakyConstantDeclaration + # rubocop:disable RSpec/LeakyConstantDeclaration,Lint/ConstantDefinitionInBlock TESTBALL_URL = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz" TESTBALL_PATCHES_URL = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1-patches.tgz" PATCH_URL_A = "file://#{TEST_FIXTURE_DIR}/patches/noop-a.diff" @@ -17,7 +17,7 @@ describe "patching" do APPLY_A = "noop-a.diff" APPLY_B = "noop-b.diff" APPLY_C = "noop-c.diff" - # rubocop:enable RSpec/LeakyConstantDeclaration + # rubocop:enable RSpec/LeakyConstantDeclaration,Lint/ConstantDefinitionInBlock url TESTBALL_URL sha256 TESTBALL_SHA256