Merge pull request #7923 from Homebrew/dependabot/bundler/Library/Homebrew/rubocop-0.87.0

build(deps): bump rubocop from 0.86.0 to 0.87.0 in /Library/Homebrew
This commit is contained in:
Mike McQuaid 2020-07-07 12:51:05 +01:00 committed by GitHub
commit 4a731732ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 53 additions and 71 deletions

View File

@ -111,15 +111,33 @@ Style/BlockDelimiters:
- '**/*_spec.rb' - '**/*_spec.rb'
- '**/shared_examples/**/*.rb' - '**/shared_examples/**/*.rb'
# don't group nicely documented or private attr_readers
Style/AccessorGrouping:
Enabled: true
Exclude:
- 'cask/cmd/internal_stanza.rb'
- 'cask/download.rb'
- 'formula.rb'
- 'formulary.rb'
- 'migrator.rb'
- 'resource.rb'
- 'system_command.rb'
- 'tap.rb'
# https://github.com/rubocop-hq/rubocop/issues/8257
Style/BisectedAttrAccessor:
Exclude:
- 'cask/url.rb'
# document our public APIs # document our public APIs
Style/Documentation: Style/Documentation:
Enabled: true Enabled: true
Include: Include:
- 'Library/Homebrew/formula.rb' - 'formula.rb'
Style/DocumentationMethod: Style/DocumentationMethod:
Enabled: true Enabled: true
Include: Include:
- 'Library/Homebrew/formula.rb' - 'formula.rb'
# don't want this for formulae but re-enabled for Library/Homebrew # don't want this for formulae but re-enabled for Library/Homebrew
Style/FrozenStringLiteralComment: Style/FrozenStringLiteralComment:

View File

@ -80,13 +80,13 @@ GEM
rspec-support (3.9.3) rspec-support (3.9.3)
rspec-wait (0.0.9) rspec-wait (0.0.9)
rspec (>= 3, < 4) rspec (>= 3, < 4)
rubocop (0.86.0) rubocop (0.87.0)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 2.7.0.1) parser (>= 2.7.1.1)
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.7) regexp_parser (>= 1.7)
rexml rexml
rubocop-ast (>= 0.0.3, < 1.0) rubocop-ast (>= 0.1.0, < 1.0)
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0) unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (0.1.0) rubocop-ast (0.1.0)

View File

@ -11,15 +11,13 @@ using HashValidator
module Cask module Cask
module Artifact module Artifact
class Pkg < AbstractArtifact class Pkg < AbstractArtifact
attr_reader :pkg_relative_path attr_reader :pkg_relative_path, :path, :stanza_options
def self.from_args(cask, path, **stanza_options) def self.from_args(cask, path, **stanza_options)
stanza_options.assert_valid_keys!(:allow_untrusted, :choices) stanza_options.assert_valid_keys!(:allow_untrusted, :choices)
new(cask, path, **stanza_options) new(cask, path, **stanza_options)
end end
attr_reader :path, :stanza_options
def initialize(cask, path, **stanza_options) def initialize(cask, path, **stanza_options)
super(cask) super(cask)
@path = cask.staged_path.join(path) @path = cask.staged_path.join(path)

View File

@ -10,8 +10,7 @@ module Cask
:nested, :nested,
]).freeze ]).freeze
attr_accessor(*VALID_KEYS) attr_accessor(*VALID_KEYS, :pairs)
attr_accessor :pairs
def initialize(pairs = {}) def initialize(pairs = {})
@pairs = pairs @pairs = pairs

View File

@ -17,8 +17,7 @@ module Cask
end end
class AbstractCaskErrorWithToken < CaskError class AbstractCaskErrorWithToken < CaskError
attr_reader :token attr_reader :token, :reason
attr_reader :reason
def initialize(token, reason = nil) def initialize(token, reason = nil)
@token = token @token = token

View File

@ -8,8 +8,7 @@ class URL
:data :data
].freeze ].freeze
attr_reader :uri, :specs attr_reader :uri, :specs, *ATTRIBUTES
attr_reader(*ATTRIBUTES)
extend Forwardable extend Forwardable
def_delegators :uri, :path, :scheme, :to_s def_delegators :uri, :path, :scheme, :to_s

View File

@ -123,8 +123,7 @@ module Homebrew
PERIODIC_CLEAN_FILE = (HOMEBREW_CACHE/".cleaned").freeze PERIODIC_CLEAN_FILE = (HOMEBREW_CACHE/".cleaned").freeze
attr_predicate :dry_run?, :scrub? attr_predicate :dry_run?, :scrub?
attr_reader :args, :days, :cache attr_reader :args, :days, :cache, :disk_cleanup_size
attr_reader :disk_cleanup_size
def initialize(*args, dry_run: false, scrub: false, days: nil, cache: HOMEBREW_CACHE) def initialize(*args, dry_run: false, scrub: false, days: nil, cache: HOMEBREW_CACHE)
@disk_cleanup_size = 0 @disk_cleanup_size = 0

View File

@ -964,8 +964,7 @@ module Homebrew
end end
class ResourceAuditor class ResourceAuditor
attr_reader :name, :version, :checksum, :url, :mirrors, :using, :specs, :owner attr_reader :name, :version, :checksum, :url, :mirrors, :using, :specs, :owner, :spec_name, :problems
attr_reader :spec_name, :problems
def initialize(resource, spec_name, options = {}) def initialize(resource, spec_name, options = {})
@name = resource.name @name = resource.name

View File

@ -201,9 +201,7 @@ module Homebrew
end end
class PatchPuller class PatchPuller
attr_reader :base_url attr_reader :base_url, :patch_url, :patchpath
attr_reader :patch_url
attr_reader :patchpath
def initialize(url, args, description = nil) def initialize(url, args, description = nil)
@base_url = url @base_url = url

View File

@ -847,12 +847,11 @@ module Homebrew
end end
return if deleted_formulae.blank? return if deleted_formulae.blank?
message = <<~EOS <<~EOS
Some installed formulae were deleted! Some installed formulae were deleted!
You should find replacements for the following formulae: You should find replacements for the following formulae:
#{deleted_formulae.join("\n ")} #{deleted_formulae.join("\n ")}
EOS EOS
message
end end
def all def all

View File

@ -21,8 +21,7 @@ class AbstractDownloadStrategy
end end
end end
attr_reader :cache, :cached_location, :url attr_reader :cache, :cached_location, :url, :meta, :name, :version, :shutup
attr_reader :meta, :name, :version, :shutup
private :meta, :name, :version, :shutup private :meta, :name, :version, :shutup
@ -1064,7 +1063,7 @@ end
class DownloadStrategyDetector class DownloadStrategyDetector
def self.detect(url, using = nil) def self.detect(url, using = nil)
strategy = if using.nil? if using.nil?
detect_from_url(url) detect_from_url(url)
elsif using.is_a?(Class) && using < AbstractDownloadStrategy elsif using.is_a?(Class) && using < AbstractDownloadStrategy
using using
@ -1072,10 +1071,8 @@ class DownloadStrategyDetector
detect_from_symbol(using) detect_from_symbol(using)
else else
raise TypeError, raise TypeError,
"Unknown download strategy specification #{strategy.inspect}" "Unknown download strategy specification #{using.inspect}"
end end
strategy
end end
def self.detect_from_url(url) def self.detect_from_url(url)

View File

@ -76,9 +76,7 @@ class FormulaUnavailableError < RuntimeError
end end
module FormulaClassUnavailableErrorModule module FormulaClassUnavailableErrorModule
attr_reader :path attr_reader :path, :class_name, :class_list
attr_reader :class_name
attr_reader :class_list
def to_s def to_s
s = super s = super
@ -223,9 +221,7 @@ class TapUnavailableError < RuntimeError
end end
class TapRemoteMismatchError < RuntimeError class TapRemoteMismatchError < RuntimeError
attr_reader :name attr_reader :name, :expected_remote, :actual_remote
attr_reader :expected_remote
attr_reader :actual_remote
def initialize(name, expected_remote, actual_remote) def initialize(name, expected_remote, actual_remote)
@name = name @name = name
@ -500,9 +496,7 @@ end
# Raised by {#safe_system} in `utils.rb`. # Raised by {#safe_system} in `utils.rb`.
class ErrorDuringExecution < RuntimeError class ErrorDuringExecution < RuntimeError
attr_reader :cmd attr_reader :cmd, :status, :output
attr_reader :status
attr_reader :output
def initialize(cmd, status:, output: nil, secrets: []) def initialize(cmd, status:, output: nil, secrets: [])
@cmd = cmd @cmd = cmd
@ -589,8 +583,7 @@ end
# Raised when a child process sends us an exception over its error pipe. # Raised when a child process sends us an exception over its error pipe.
class ChildProcessError < RuntimeError class ChildProcessError < RuntimeError
attr_reader :inner attr_reader :inner, :inner_class
attr_reader :inner_class
def initialize(inner) def initialize(inner)
@inner = inner @inner = inner

View File

@ -17,8 +17,7 @@ module Superenv
include SharedEnvExtension include SharedEnvExtension
# @private # @private
attr_accessor :keg_only_deps, :deps, :run_time_deps attr_accessor :keg_only_deps, :deps, :run_time_deps, :x11
attr_accessor :x11
def self.extended(base) def self.extended(base)
base.keg_only_deps = [] base.keg_only_deps = []

View File

@ -1902,12 +1902,10 @@ class Formula
keg = opt_or_installed_prefix_keg keg = opt_or_installed_prefix_keg
return [] unless keg return [] unless keg
undeclared_deps = CacheStoreDatabase.use(:linkage) do |db| CacheStoreDatabase.use(:linkage) do |db|
linkage_checker = LinkageChecker.new(keg, self, cache_db: db) linkage_checker = LinkageChecker.new(keg, self, cache_db: db)
linkage_checker.undeclared_deps.map { |n| Dependency.new(n) } linkage_checker.undeclared_deps.map { |n| Dependency.new(n) }
end end
undeclared_deps
end end
public public

View File

@ -37,8 +37,7 @@ class FormulaInstaller
end end
attr_reader :formula attr_reader :formula
attr_accessor :options, :build_bottle attr_accessor :options, :build_bottle, :installed_as_dependency, :installed_on_request, :link_keg
attr_accessor :installed_as_dependency, :installed_on_request, :link_keg
mode_attr_accessor :show_summary_heading, :show_header mode_attr_accessor :show_summary_heading, :show_header
mode_attr_accessor :build_from_source, :force_bottle, :include_test mode_attr_accessor :build_from_source, :force_bottle, :include_test
@ -398,9 +397,7 @@ class FormulaInstaller
def compute_dependencies def compute_dependencies
req_map, req_deps = expand_requirements req_map, req_deps = expand_requirements
check_requirements(req_map) check_requirements(req_map)
deps = expand_dependencies(req_deps + formula.deps) expand_dependencies(req_deps + formula.deps)
deps
end end
# Check that each dependency in deps has a bottle available, terminating # Check that each dependency in deps has a bottle available, terminating

View File

@ -6,7 +6,7 @@ require "linkage_cache_store"
require "fiddle" require "fiddle"
class LinkageChecker class LinkageChecker
attr_reader :undeclared_deps attr_reader :undeclared_deps, :keg, :formula, :store
def initialize(keg, formula = nil, cache_db:, rebuild_cache: false) def initialize(keg, formula = nil, cache_db:, rebuild_cache: false)
@keg = keg @keg = keg
@ -71,8 +71,6 @@ class LinkageChecker
private private
attr_reader :keg, :formula, :store
def dylib_to_dep(dylib) def dylib_to_dep(dylib)
dylib =~ %r{#{Regexp.escape(HOMEBREW_PREFIX)}/(opt|Cellar)/([\w+-.@]+)/} dylib =~ %r{#{Regexp.escape(HOMEBREW_PREFIX)}/(opt|Cellar)/([\w+-.@]+)/}
Regexp.last_match(2) Regexp.last_match(2)

View File

@ -87,7 +87,7 @@ module RuboCop
first_word = string_content(node).split.first first_word = string_content(node).split.first
unless VALID_LOWERCASE_WORDS.include?(first_word) unless VALID_LOWERCASE_WORDS.include?(first_word)
first_char = first_word.to_s.chars.first first_char = first_word.to_s.chars.first
correction.sub!(/^(['"]?)([a-z])/, "\\1#{first_char.upcase}") correction.sub!(/^(['"]?)([a-z])/, "\\1#{first_char.upcase}") if first_char
end end
correction.sub!(/^(['"]?)an?\s/i, "\\1") correction.sub!(/^(['"]?)an?\s/i, "\\1")
correction.gsub!(/(ommand ?line)/i, "ommand-line") correction.gsub!(/(ommand ?line)/i, "ommand-line")

View File

@ -20,19 +20,13 @@ class SoftwareSpec
cxx11: Option.new("c++11", "Build using C++11 mode"), cxx11: Option.new("c++11", "Build using C++11 mode"),
}.freeze }.freeze
attr_reader :name, :full_name, :owner attr_reader :name, :full_name, :owner, :build, :resources, :patches, :options, :deprecated_flags,
attr_reader :build, :resources, :patches, :options :deprecated_options, :dependency_collector, :bottle_specification, :compiler_failures,
attr_reader :deprecated_flags, :deprecated_options :uses_from_macos_elements, :bottle_disable_reason
attr_reader :dependency_collector
attr_reader :bottle_specification
attr_reader :compiler_failures
attr_reader :uses_from_macos_elements
def_delegators :@resource, :stage, :fetch, :verify_download_integrity, :source_modified_time def_delegators :@resource, :stage, :fetch, :verify_download_integrity, :source_modified_time, :download_name,
def_delegators :@resource, :download_name, :cached_download, :clear_cache :cached_download, :clear_cache, :checksum, :mirrors, :specs, :using, :version, :mirror,
def_delegators :@resource, :checksum, :mirrors, :specs, :using :downloader, *Checksum::TYPES
def_delegators :@resource, :version, :mirror, *Checksum::TYPES
def_delegators :@resource, :downloader
def initialize def initialize
@resource = Resource.new @resource = Resource.new
@ -87,8 +81,6 @@ class SoftwareSpec
@bottle_disable_reason ? true : false @bottle_disable_reason ? true : false
end end
attr_reader :bottle_disable_reason
def bottle_defined? def bottle_defined?
!bottle_specification.collector.keys.empty? !bottle_specification.collector.keys.empty?
end end

View File

@ -35,8 +35,8 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/mime-types-3.3.1/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/net-http-digest_auth-1.4.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/net-http-digest_auth-1.4.1/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/net-http-persistent-4.0.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/net-http-persistent-4.0.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/mini_portile2-2.4.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/mini_portile2-2.4.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/universal-darwin-19/2.6.0/nokogiri-1.10.9" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/universal-darwin-19/2.6.0/nokogiri-1.10.10"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/nokogiri-1.10.9/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/nokogiri-1.10.10/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ntlm-http-0.1.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ntlm-http-0.1.1/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/webrobots-0.1.2/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/webrobots-0.1.2/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/mechanize-2.7.6/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/mechanize-2.7.6/lib"
@ -62,7 +62,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-wait-0.0.9/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-ast-0.1.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-ast-0.1.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-progressbar-1.10.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-progressbar-1.10.1/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unicode-display_width-1.7.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unicode-display_width-1.7.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-0.86.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-0.87.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.6.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.6.1/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-1.41.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-1.41.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-2.2.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-2.2.0/lib"