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'
- '**/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
Style/Documentation:
Enabled: true
Include:
- 'Library/Homebrew/formula.rb'
- 'formula.rb'
Style/DocumentationMethod:
Enabled: true
Include:
- 'Library/Homebrew/formula.rb'
- 'formula.rb'
# don't want this for formulae but re-enabled for Library/Homebrew
Style/FrozenStringLiteralComment:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1902,12 +1902,10 @@ class Formula
keg = opt_or_installed_prefix_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.undeclared_deps.map { |n| Dependency.new(n) }
end
undeclared_deps
end
public

View File

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

View File

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

View File

@ -87,7 +87,7 @@ module RuboCop
first_word = string_content(node).split.first
unless VALID_LOWERCASE_WORDS.include?(first_word)
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
correction.sub!(/^(['"]?)an?\s/i, "\\1")
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"),
}.freeze
attr_reader :name, :full_name, :owner
attr_reader :build, :resources, :patches, :options
attr_reader :deprecated_flags, :deprecated_options
attr_reader :dependency_collector
attr_reader :bottle_specification
attr_reader :compiler_failures
attr_reader :uses_from_macos_elements
attr_reader :name, :full_name, :owner, :build, :resources, :patches, :options, :deprecated_flags,
:deprecated_options, :dependency_collector, :bottle_specification, :compiler_failures,
:uses_from_macos_elements, :bottle_disable_reason
def_delegators :@resource, :stage, :fetch, :verify_download_integrity, :source_modified_time
def_delegators :@resource, :download_name, :cached_download, :clear_cache
def_delegators :@resource, :checksum, :mirrors, :specs, :using
def_delegators :@resource, :version, :mirror, *Checksum::TYPES
def_delegators :@resource, :downloader
def_delegators :@resource, :stage, :fetch, :verify_download_integrity, :source_modified_time, :download_name,
:cached_download, :clear_cache, :checksum, :mirrors, :specs, :using, :version, :mirror,
:downloader, *Checksum::TYPES
def initialize
@resource = Resource.new
@ -87,8 +81,6 @@ class SoftwareSpec
@bottle_disable_reason ? true : false
end
attr_reader :bottle_disable_reason
def bottle_defined?
!bottle_specification.collector.keys.empty?
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-persistent-4.0.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}/gems/nokogiri-1.10.9/lib"
$:.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.10/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/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/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/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-rspec-1.41.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-2.2.0/lib"