diff --git a/Library/Homebrew/.rubocop_todo.yml b/Library/Homebrew/.rubocop_todo.yml index bcb1247506..202c187f07 100644 --- a/Library/Homebrew/.rubocop_todo.yml +++ b/Library/Homebrew/.rubocop_todo.yml @@ -22,14 +22,3 @@ Style/Documentation: - "utils/popen.rb" - "utils/shell.rb" - "version.rb" - -Lint/EmptyBlock: - Exclude: - - "dev-cmd/extract.rb" - - "test/cache_store_spec.rb" - - "test/checksum_verification_spec.rb" - - "test/compiler_failure_spec.rb" - - "test/formula_spec.rb" - - "test/formula_validation_spec.rb" - - "test/pathname_spec.rb" - - "test/support/fixtures/cask/Casks/*flight*.rb" diff --git a/Library/Homebrew/dev-cmd/extract.rb b/Library/Homebrew/dev-cmd/extract.rb index 91ade54b16..6207ac7702 100644 --- a/Library/Homebrew/dev-cmd/extract.rb +++ b/Library/Homebrew/dev-cmd/extract.rb @@ -10,22 +10,30 @@ require "tap" def with_monkey_patch BottleSpecification.class_eval do alias_method :old_method_missing, :method_missing if method_defined?(:method_missing) - define_method(:method_missing) { |*| } + define_method(:method_missing) do |*| + # do nothing + end end Module.class_eval do alias_method :old_method_missing, :method_missing if method_defined?(:method_missing) - define_method(:method_missing) { |*| } + define_method(:method_missing) do |*| + # do nothing + end end Resource.class_eval do alias_method :old_method_missing, :method_missing if method_defined?(:method_missing) - define_method(:method_missing) { |*| } + define_method(:method_missing) do |*| + # do nothing + end end DependencyCollector.class_eval do alias_method :old_parse_symbol_spec, :parse_symbol_spec if method_defined?(:parse_symbol_spec) - define_method(:parse_symbol_spec) { |*| } + define_method(:parse_symbol_spec) do |*| + # do nothing + end end yield diff --git a/Library/Homebrew/test/cache_store_spec.rb b/Library/Homebrew/test/cache_store_spec.rb index 91df263a74..3506b7922b 100644 --- a/Library/Homebrew/test/cache_store_spec.rb +++ b/Library/Homebrew/test/cache_store_spec.rb @@ -13,7 +13,9 @@ describe CacheStoreDatabase do cache_store = instance_double(described_class, "cache_store", write_if_dirty!: nil) expect(described_class).to receive(:new).with(type).and_return(cache_store) expect(cache_store).to receive(:write_if_dirty!) - described_class.use(type) { |_db| } + described_class.use(type) { |_db| + # do nothing + } end end diff --git a/Library/Homebrew/test/checksum_verification_spec.rb b/Library/Homebrew/test/checksum_verification_spec.rb index b1a7a7f624..a2028e2603 100644 --- a/Library/Homebrew/test/checksum_verification_spec.rb +++ b/Library/Homebrew/test/checksum_verification_spec.rb @@ -18,7 +18,9 @@ describe Formula do sha256 TESTBALL_SHA256 end - f.brew {} + f.brew { + # do nothing + } }.not_to raise_error end @@ -28,7 +30,9 @@ describe Formula do sha256 "dcbf5f44743b74add648c7e35e414076632fa3b24463d68d1f6afc5be77024f8" end - f.brew {} + f.brew { + # do nothing + } }.to raise_error(ChecksumMismatchError) end end diff --git a/Library/Homebrew/test/compiler_failure_spec.rb b/Library/Homebrew/test/compiler_failure_spec.rb index f24c6f3536..2144837a7d 100644 --- a/Library/Homebrew/test/compiler_failure_spec.rb +++ b/Library/Homebrew/test/compiler_failure_spec.rb @@ -22,7 +22,9 @@ describe CompilerFailure do end it "can be given an empty block" do - failure = described_class.create(:clang) {} + failure = described_class.create(:clang) { + # do nothing + } expect(failure).to fail_with( instance_double(CompilerSelector::Compiler, "Compiler", type: :clang, name: :clang, version: 600), ) diff --git a/Library/Homebrew/test/formula_spec.rb b/Library/Homebrew/test/formula_spec.rb index 723efa62b9..59b344e37b 100644 --- a/Library/Homebrew/test/formula_spec.rb +++ b/Library/Homebrew/test/formula_spec.rb @@ -872,7 +872,11 @@ describe Formula do end expect(Set.new(f2.recursive_requirements)).to eq(Set[]) - expect(Set.new(f2.recursive_requirements {})).to eq(Set[xcode]) + expect( + f2.recursive_requirements { + # do nothing + }.to_set, + ).to eq(Set[xcode]) requirements = f2.recursive_requirements do |_dependent, requirement| Requirement.prune if requirement.is_a?(XcodeRequirement) diff --git a/Library/Homebrew/test/formula_validation_spec.rb b/Library/Homebrew/test/formula_validation_spec.rb index 30077967f0..8f4b052e2f 100644 --- a/Library/Homebrew/test/formula_validation_spec.rb +++ b/Library/Homebrew/test/formula_validation_spec.rb @@ -80,7 +80,11 @@ describe Formula do end it "fails when Formula is empty" do - expect { formula {} }.to raise_error(FormulaSpecificationError) + expect { + formula { + # do nothing + } + }.to raise_error(FormulaSpecificationError) end end end diff --git a/Library/Homebrew/test/pathname_spec.rb b/Library/Homebrew/test/pathname_spec.rb index 0611260c7f..98a20f3629 100644 --- a/Library/Homebrew/test/pathname_spec.rb +++ b/Library/Homebrew/test/pathname_spec.rb @@ -93,7 +93,9 @@ describe Pathname do end it "preserves permissions" do - File.open(file, "w", 0100777) {} + File.open(file, "w", 0100777) { + # do nothing + } file.atomic_write("CONTENT") expect(file.stat.mode.to_s(8)).to eq((~File.umask & 0100777).to_s(8)) end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-postflight-multi.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-postflight-multi.rb index f0b82d4716..7fb1bec476 100644 --- a/Library/Homebrew/test/support/fixtures/cask/Casks/with-postflight-multi.rb +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-postflight-multi.rb @@ -8,7 +8,9 @@ cask "with-postflight-multi" do pkg "MyFancyPkg/Fancy.pkg" postflight do + # do nothing end postflight do + # do nothing end end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-postflight.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-postflight.rb index b14223ccbd..a4b3bf701c 100644 --- a/Library/Homebrew/test/support/fixtures/cask/Casks/with-postflight.rb +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-postflight.rb @@ -8,5 +8,6 @@ cask "with-postflight" do pkg "MyFancyPkg/Fancy.pkg" postflight do + # do nothing end end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-preflight-multi.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-preflight-multi.rb index c62bfdcebc..3732c141ba 100644 --- a/Library/Homebrew/test/support/fixtures/cask/Casks/with-preflight-multi.rb +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-preflight-multi.rb @@ -8,7 +8,9 @@ cask "with-preflight-multi" do pkg "MyFancyPkg/Fancy.pkg" preflight do + # do nothing end preflight do + # do nothing end end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-preflight.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-preflight.rb index 29bc0b0c16..1da7ed88e6 100644 --- a/Library/Homebrew/test/support/fixtures/cask/Casks/with-preflight.rb +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-preflight.rb @@ -8,5 +8,6 @@ cask "with-preflight" do pkg "MyFancyPkg/Fancy.pkg" preflight do + # do nothing end end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-postflight-multi.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-postflight-multi.rb index 52e5e6420b..4da9516966 100644 --- a/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-postflight-multi.rb +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-postflight-multi.rb @@ -8,7 +8,9 @@ cask "with-uninstall-postflight-multi" do pkg "MyFancyPkg/Fancy.pkg" uninstall_postflight do + # do nothing end uninstall_postflight do + # do nothing end end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-postflight.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-postflight.rb index c400a7edd1..b07760d099 100644 --- a/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-postflight.rb +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-postflight.rb @@ -8,5 +8,6 @@ cask "with-uninstall-postflight" do pkg "MyFancyPkg/Fancy.pkg" uninstall_postflight do + # do nothing end end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-preflight-multi.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-preflight-multi.rb index d743984fde..7bf6bbf9fa 100644 --- a/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-preflight-multi.rb +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-preflight-multi.rb @@ -8,7 +8,9 @@ cask "with-uninstall-preflight-multi" do pkg "MyFancyPkg/Fancy.pkg" uninstall_preflight do + # do nothing end uninstall_preflight do + # do nothing end end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-preflight.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-preflight.rb index b4d73a0e6c..2af130cca8 100644 --- a/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-preflight.rb +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-preflight.rb @@ -8,5 +8,6 @@ cask "with-uninstall-preflight" do pkg "MyFancyPkg/Fancy.pkg" uninstall_preflight do + # do nothing end end