Merge pull request #14710 from issyl0/rubocop-excludes
rubocop: Clean up some `Exclude`s
This commit is contained in:
commit
aaec4014fd
@ -290,28 +290,12 @@ Layout/FirstHashElementIndentation:
|
|||||||
Lint/AmbiguousBlockAssociation:
|
Lint/AmbiguousBlockAssociation:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Lint/RequireRelativeSelfPath:
|
|
||||||
# bugged on formula-analytics
|
|
||||||
# https://github.com/Homebrew/brew/pull/12152/checks?check_run_id=3755137378#step:15:60
|
|
||||||
Exclude:
|
|
||||||
- "Taps/homebrew/homebrew-formula-analytics/*/*.rb"
|
|
||||||
|
|
||||||
Lint/DuplicateBranch:
|
Lint/DuplicateBranch:
|
||||||
Exclude:
|
Exclude:
|
||||||
- "Taps/*/*/*.rb"
|
- "Taps/*/*/*.rb"
|
||||||
- "/**/{Formula,Casks}/*.rb"
|
- "/**/{Formula,Casks}/*.rb"
|
||||||
- "**/{Formula,Casks}/*.rb"
|
- "**/{Formula,Casks}/*.rb"
|
||||||
|
|
||||||
# needed for lazy_object magic
|
|
||||||
Naming/MemoizedInstanceVariableName:
|
|
||||||
Exclude:
|
|
||||||
- "Homebrew/lazy_object.rb"
|
|
||||||
|
|
||||||
# useful for metaprogramming in RSpec
|
|
||||||
Lint/ConstantDefinitionInBlock:
|
|
||||||
Exclude:
|
|
||||||
- "**/*_spec.rb"
|
|
||||||
|
|
||||||
# so many of these in formulae and can't be autocorrected
|
# so many of these in formulae and can't be autocorrected
|
||||||
Lint/ParenthesesAsGroupedExpression:
|
Lint/ParenthesesAsGroupedExpression:
|
||||||
Exclude:
|
Exclude:
|
||||||
|
|||||||
@ -12,28 +12,15 @@ Layout/MultilineMethodCallIndentation:
|
|||||||
Exclude:
|
Exclude:
|
||||||
- "**/*_spec.rb"
|
- "**/*_spec.rb"
|
||||||
|
|
||||||
# `formula do` uses nested method definitions
|
|
||||||
Lint/NestedMethodDefinition:
|
|
||||||
Exclude:
|
|
||||||
- "test/**/*"
|
|
||||||
|
|
||||||
# TODO: Try to bring down all metrics maximums.
|
# TODO: Try to bring down all metrics maximums.
|
||||||
Metrics/AbcSize:
|
Metrics/AbcSize:
|
||||||
Max: 241
|
Max: 241
|
||||||
Metrics/BlockLength:
|
Metrics/BlockLength:
|
||||||
Max: 86
|
Max: 86
|
||||||
Exclude:
|
|
||||||
# TODO: extract more of the bottling logic
|
|
||||||
- "dev-cmd/bottle.rb"
|
|
||||||
- "test/**/*"
|
|
||||||
- "cmd/install.rb"
|
|
||||||
Metrics/BlockNesting:
|
Metrics/BlockNesting:
|
||||||
Max: 5
|
Max: 5
|
||||||
Metrics/ClassLength:
|
Metrics/ClassLength:
|
||||||
Max: 736
|
Max: 736
|
||||||
Exclude:
|
|
||||||
- "formula.rb"
|
|
||||||
- "formula_installer.rb"
|
|
||||||
Metrics/CyclomaticComplexity:
|
Metrics/CyclomaticComplexity:
|
||||||
Max: 68
|
Max: 68
|
||||||
Metrics/PerceivedComplexity:
|
Metrics/PerceivedComplexity:
|
||||||
@ -42,12 +29,6 @@ Metrics/MethodLength:
|
|||||||
Max: 232
|
Max: 232
|
||||||
Metrics/ModuleLength:
|
Metrics/ModuleLength:
|
||||||
Max: 481
|
Max: 481
|
||||||
Exclude:
|
|
||||||
# TODO: extract more of the bottling logic
|
|
||||||
- "dev-cmd/bottle.rb"
|
|
||||||
# TODO: try break this down
|
|
||||||
- "utils/github.rb"
|
|
||||||
- "test/**/*"
|
|
||||||
|
|
||||||
Naming/PredicateName:
|
Naming/PredicateName:
|
||||||
# Can't rename these.
|
# Can't rename these.
|
||||||
@ -87,5 +68,4 @@ Style/BlockDelimiters:
|
|||||||
- "sig"
|
- "sig"
|
||||||
|
|
||||||
Bundler/GemFilename:
|
Bundler/GemFilename:
|
||||||
Exclude:
|
Enabled: false
|
||||||
- "utils/gems.rb"
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ module Homebrew
|
|||||||
|
|
||||||
sig { returns(CLI::Parser) }
|
sig { returns(CLI::Parser) }
|
||||||
def install_args
|
def install_args
|
||||||
Homebrew::CLI::Parser.new do
|
Homebrew::CLI::Parser.new do # rubocop:disable Metrics/BlockLength
|
||||||
description <<~EOS
|
description <<~EOS
|
||||||
Install a <formula> or <cask>. Additional options specific to a <formula> may be
|
Install a <formula> or <cask>. Additional options specific to a <formula> may be
|
||||||
appended to the command.
|
appended to the command.
|
||||||
|
|||||||
@ -35,7 +35,7 @@ ALLOWABLE_HOMEBREW_REPOSITORY_LINKS = [
|
|||||||
%r{#{Regexp.escape(HOMEBREW_LIBRARY)}/Homebrew/os/(mac|linux)/pkgconfig},
|
%r{#{Regexp.escape(HOMEBREW_LIBRARY)}/Homebrew/os/(mac|linux)/pkgconfig},
|
||||||
].freeze
|
].freeze
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew # rubocop:disable Metrics/ModuleLength
|
||||||
extend T::Sig
|
extend T::Sig
|
||||||
|
|
||||||
module_function
|
module_function
|
||||||
@ -591,7 +591,7 @@ module Homebrew
|
|||||||
bottles_hash = merge_json_files(parse_json_files(args.named))
|
bottles_hash = merge_json_files(parse_json_files(args.named))
|
||||||
|
|
||||||
any_cellars = ["any", "any_skip_relocation"]
|
any_cellars = ["any", "any_skip_relocation"]
|
||||||
bottles_hash.each do |formula_name, bottle_hash|
|
bottles_hash.each do |formula_name, bottle_hash| # rubocop:disable Metrics/BlockLength
|
||||||
ohai formula_name
|
ohai formula_name
|
||||||
|
|
||||||
bottle = BottleSpecification.new
|
bottle = BottleSpecification.new
|
||||||
|
|||||||
@ -56,7 +56,7 @@ require "api"
|
|||||||
# system "make", "install"
|
# system "make", "install"
|
||||||
# end
|
# end
|
||||||
# end</pre>
|
# end</pre>
|
||||||
class Formula
|
class Formula # rubocop:disable Metrics/ClassLength
|
||||||
extend T::Sig
|
extend T::Sig
|
||||||
|
|
||||||
include FileUtils
|
include FileUtils
|
||||||
|
|||||||
@ -26,7 +26,7 @@ require "service"
|
|||||||
# Installer for a formula.
|
# Installer for a formula.
|
||||||
#
|
#
|
||||||
# @api private
|
# @api private
|
||||||
class FormulaInstaller
|
class FormulaInstaller # rubocop:disable Metrics/ClassLength
|
||||||
extend T::Sig
|
extend T::Sig
|
||||||
|
|
||||||
include FormulaCellarChecks
|
include FormulaCellarChecks
|
||||||
|
|||||||
@ -10,9 +10,11 @@ class LazyObject < Delegator
|
|||||||
end
|
end
|
||||||
|
|
||||||
def __getobj__
|
def __getobj__
|
||||||
|
# rubocop:disable Naming/MemoizedInstanceVariableName
|
||||||
return @__delegate__ if defined?(@__delegate__)
|
return @__delegate__ if defined?(@__delegate__)
|
||||||
|
|
||||||
@__delegate__ = @__callable__.call
|
@__delegate__ = @__callable__.call
|
||||||
|
# rubocop:enable Naming/MemoizedInstanceVariableName
|
||||||
end
|
end
|
||||||
|
|
||||||
def __setobj__(callable)
|
def __setobj__(callable)
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
require "benchmark"
|
require "benchmark"
|
||||||
|
|
||||||
shared_examples "#uninstall_phase or #zap_phase" do
|
shared_examples "#uninstall_phase or #zap_phase" do # rubocop:disable Metrics/BlockLength
|
||||||
subject { artifact }
|
subject { artifact }
|
||||||
|
|
||||||
let(:artifact_dsl_key) { described_class.dsl_key }
|
let(:artifact_dsl_key) { described_class.dsl_key }
|
||||||
|
|||||||
@ -17,7 +17,7 @@ module Count
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew # rubocop:disable Metrics/ModuleLength
|
||||||
describe FormulaTextAuditor do
|
describe FormulaTextAuditor do
|
||||||
alias_matcher :have_data, :be_data
|
alias_matcher :have_data, :be_data
|
||||||
alias_matcher :have_end, :be_end
|
alias_matcher :have_end, :be_end
|
||||||
|
|||||||
@ -90,11 +90,11 @@ describe "Exception" do
|
|||||||
let(:mod) do
|
let(:mod) do
|
||||||
Module.new do
|
Module.new do
|
||||||
# These are defined within an anonymous module to avoid polluting the global namespace.
|
# 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 Bar < Requirement; end
|
||||||
|
|
||||||
class Baz < Formula; end
|
class Baz < Formula; end
|
||||||
# rubocop:enable RSpec/LeakyConstantDeclaration
|
# rubocop:enable RSpec/LeakyConstantDeclaration,Lint/ConstantDefinitionInBlock
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@ describe "patching" do
|
|||||||
let(:formula_subclass) {
|
let(:formula_subclass) {
|
||||||
Class.new(Formula) {
|
Class.new(Formula) {
|
||||||
# These are defined within an anonymous class to avoid polluting the global namespace.
|
# 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_URL = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
|
||||||
TESTBALL_PATCHES_URL = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1-patches.tgz"
|
TESTBALL_PATCHES_URL = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1-patches.tgz"
|
||||||
PATCH_URL_A = "file://#{TEST_FIXTURE_DIR}/patches/noop-a.diff"
|
PATCH_URL_A = "file://#{TEST_FIXTURE_DIR}/patches/noop-a.diff"
|
||||||
@ -17,7 +17,7 @@ describe "patching" do
|
|||||||
APPLY_A = "noop-a.diff"
|
APPLY_A = "noop-a.diff"
|
||||||
APPLY_B = "noop-b.diff"
|
APPLY_B = "noop-b.diff"
|
||||||
APPLY_C = "noop-c.diff"
|
APPLY_C = "noop-c.diff"
|
||||||
# rubocop:enable RSpec/LeakyConstantDeclaration
|
# rubocop:enable RSpec/LeakyConstantDeclaration,Lint/ConstantDefinitionInBlock
|
||||||
|
|
||||||
url TESTBALL_URL
|
url TESTBALL_URL
|
||||||
sha256 TESTBALL_SHA256
|
sha256 TESTBALL_SHA256
|
||||||
|
|||||||
@ -63,7 +63,7 @@ TEST_DIRECTORIES = [
|
|||||||
# work when type-checking is active.
|
# work when type-checking is active.
|
||||||
RSpec::Sorbet.allow_doubles!
|
RSpec::Sorbet.allow_doubles!
|
||||||
|
|
||||||
RSpec.configure do |config|
|
RSpec.configure do |config| # rubocop:disable Metrics/BlockLength
|
||||||
config.order = :random
|
config.order = :random
|
||||||
|
|
||||||
config.raise_errors_for_deprecations!
|
config.raise_errors_for_deprecations!
|
||||||
@ -181,7 +181,7 @@ RSpec.configure do |config|
|
|||||||
skip "Unzip is not installed." unless which("unzip")
|
skip "Unzip is not installed." unless which("unzip")
|
||||||
end
|
end
|
||||||
|
|
||||||
config.around do |example|
|
config.around do |example| # rubocop:disable Metrics/BlockLength
|
||||||
def find_files
|
def find_files
|
||||||
return [] unless File.exist?(TEST_TMPDIR)
|
return [] unless File.exist?(TEST_TMPDIR)
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@ require "system_command"
|
|||||||
# Wrapper functions for the GitHub API.
|
# Wrapper functions for the GitHub API.
|
||||||
#
|
#
|
||||||
# @api private
|
# @api private
|
||||||
module GitHub
|
module GitHub # rubocop:disable Metrics/ModuleLength
|
||||||
extend T::Sig
|
extend T::Sig
|
||||||
|
|
||||||
include SystemCommand::Mixin
|
include SystemCommand::Mixin
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user