Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump rubocop from 1.17.0 to 1.18.2 in /Library/Homebrew #11642

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions Library/.rubocop.yml
Expand Up @@ -84,6 +84,25 @@ Naming/HeredocDelimiterNaming:
ForbiddenDelimiters:
- END, EOD, EOF

Naming/InclusiveLanguage:
CheckStrings: true
FlaggedTerms:
# TODO: If possible, make this stricter.
slave:
AllowedRegex:
- "gitslave" # Used in formula `gitslave`
- "log_slave" # Used in formula `ssdb`
- "ssdb_slave" # Used in formula `ssdb`
- "var_slave" # Used in formula `ssdb`
- "patches/13_fix_scope_for_show_slave_status_data.patch" # Used in formula `mytop`
blacklist:
AllowedRegex:
- "--listBlacklist" # Used in formula `xmlsectool`
whitelist:
AllowedRegex:
- "--error-white-list" # For an option passed to `srb` in dev-cmd/typecheck.rb
- "--repo-whitelist" # Used in formula `atlantis`

Naming/MethodName:
IgnoredPatterns:
- '\A(fetch_)?HEAD\?\Z'
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/Gemfile.lock
Expand Up @@ -112,7 +112,7 @@ GEM
rspec (>= 3, < 4)
rspec_junit_formatter (0.4.1)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (1.17.0)
rubocop (1.18.2)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/cask/cask.rb
Expand Up @@ -102,11 +102,11 @@ def install_time

def installed_caskfile
installed_version = timestamped_versions.last
metadata_master_container_path.join(*installed_version, "Casks", "#{token}.rb")
metadata_main_container_path.join(*installed_version, "Casks", "#{token}.rb")
end

def config_path
metadata_master_container_path/"config.json"
metadata_main_container_path/"config.json"
end

def caskroom_path
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cask/installer.rb
Expand Up @@ -538,7 +538,7 @@ def purge_versioned_files

@cask.metadata_versioned_path.rmdir_if_possible
end
@cask.metadata_master_container_path.rmdir_if_possible unless upgrade?
@cask.metadata_main_container_path.rmdir_if_possible unless upgrade?

# toplevel staged distribution
@cask.caskroom_path.rmdir_if_possible unless upgrade?
Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/cask/metadata.rb
Expand Up @@ -9,16 +9,16 @@ module Metadata
METADATA_SUBDIR = ".metadata"
TIMESTAMP_FORMAT = "%Y%m%d%H%M%S.%L"

def metadata_master_container_path
@metadata_master_container_path ||= caskroom_path.join(METADATA_SUBDIR)
def metadata_main_container_path
@metadata_main_container_path ||= caskroom_path.join(METADATA_SUBDIR)
end

def metadata_versioned_path(version: self.version)
cask_version = (version || :unknown).to_s

raise CaskError, "Cannot create metadata path with empty version." if cask_version.empty?

metadata_master_container_path.join(cask_version)
metadata_main_container_path.join(cask_version)
end

def metadata_timestamped_path(version: self.version, timestamp: :latest, create: false)
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cmd/install.rb
Expand Up @@ -74,7 +74,7 @@ def install_args
description: "Install testing dependencies required to run `brew test` <formula>.",
}],
[:switch, "--HEAD", {
description: "If <formula> defines it, install the HEAD version, aka. master, trunk, unstable.",
description: "If <formula> defines it, install the HEAD version, aka. main, trunk, unstable, master.",
}],
[:switch, "--fetch-HEAD", {
description: "Fetch the upstream repository to detect if the HEAD installation of the " \
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/formulary.rb
Expand Up @@ -275,7 +275,7 @@ def initialize(url)
def load_file(flags:, ignore_errors:)
if %r{githubusercontent.com/[\w-]+/[\w-]+/[a-f0-9]{40}(?:/Formula)?/(?<formula_name>[\w+-.@]+).rb} =~ url
raise UsageError, "Installation of #{formula_name} from a GitHub commit URL is unsupported! " \
"`brew extract #{formula_name}` to a stable tap on GitHub instead."
"`brew extract #{formula_name}` to a stable tap on GitHub instead."
elsif url.match?(%r{^(https?|ftp)://})
raise UsageError, "Non-checksummed download of #{name} formula file from an arbitrary URL is unsupported! ",
"`brew extract` or `brew create` and `brew tap-new` to create a "\
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/rubocops/components_order.rb
Expand Up @@ -196,8 +196,8 @@ def component_problem(c1, c2)
return if tap_style_exception? :components_order_exceptions

problem "`#{format_component(c1)}` (line #{line_number(c1)}) " \
"should be put before `#{format_component(c2)}` " \
"(line #{line_number(c2)})" do |corrector|
"should be put before `#{format_component(c2)}` " \
"(line #{line_number(c2)})" do |corrector|
reorder_components(corrector, c1, c2)
end
end
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/rubocops/lines.rb
Expand Up @@ -205,7 +205,7 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)

find_method_with_args(body_node, :depends_on, "mpich") do
problem "Formulae in homebrew/core should use 'depends_on \"open-mpi\"' " \
"instead of '#{@offensive_node.source}'." do |corrector|
"instead of '#{@offensive_node.source}'." do |corrector|
corrector.replace(@offensive_node.source_range, "depends_on \"open-mpi\"")
end
end
Expand Down Expand Up @@ -340,7 +340,7 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)

offending_node(str)
problem "References to `#{content}` should "\
"match the specified python dependency (`#{fix}`)" do |corrector|
"match the specified python dependency (`#{fix}`)" do |corrector|
corrector.replace(str.source_range, "\"#{fix}\"")
end
end
Expand Down
Expand Up @@ -1075,16 +1075,19 @@ class RuboCop::Cop::Bundler::GemVersion < ::RuboCop::Cop::Base
include ::RuboCop::Cop::ConfigurableEnforcedStyle
include ::RuboCop::Cop::GemDeclaration

def includes_commit_reference?(param0 = T.unsafe(nil)); end
def includes_version_specification?(param0 = T.unsafe(nil)); end
def on_send(node); end

private

def allowed_gem?(node); end
def allowed_gems; end
def forbidden_offense?(node); end
def forbidden_style?; end
def message(range); end
def offense?(node); end
def required_offense?(node); end
def required_style?; end
def version_specification?(expression); end
end
Expand Down Expand Up @@ -1153,6 +1156,7 @@ module RuboCop::Cop::CheckLineBreakable
def contained_by_multiline_collection_that_could_be_broken_up?(node); end
def extract_breakable_node_from_elements(node, elements, max); end
def extract_first_element_over_column_limit(node, elements, max); end
def first_argument_is_heredoc?(node); end
def process_args(args); end
def safe_to_ignore?(node); end
def shift_elements_for_heredoc_arg(node, elements, index); end
Expand Down Expand Up @@ -3177,6 +3181,29 @@ end

RuboCop::Cop::Layout::LeadingEmptyLines::MSG = T.let(T.unsafe(nil), String)

class RuboCop::Cop::Layout::LineEndStringConcatenationIndentation < ::RuboCop::Cop::Base
include ::RuboCop::Cop::ConfigurableEnforcedStyle
include ::RuboCop::Cop::Alignment
extend ::RuboCop::Cop::AutoCorrector

def autocorrect(corrector, node); end
def on_dstr(node); end

private

def add_offense_and_correction(node, message); end
def always_aligned?(dstr_node); end
def always_indented?(dstr_node); end
def check_aligned(children, start_index); end
def check_indented(children); end
def single_string_literal?(dstr_node); end
def strings_concatenated_with_backslash?(dstr_node); end
end

RuboCop::Cop::Layout::LineEndStringConcatenationIndentation::MSG_ALIGN = T.let(T.unsafe(nil), String)
RuboCop::Cop::Layout::LineEndStringConcatenationIndentation::MSG_INDENT = T.let(T.unsafe(nil), String)
RuboCop::Cop::Layout::LineEndStringConcatenationIndentation::PARENT_TYPES_FOR_INDENTED = T.let(T.unsafe(nil), Array)

class RuboCop::Cop::Layout::LineLength < ::RuboCop::Cop::Base
include ::RuboCop::Cop::CheckLineBreakable
include ::RuboCop::Cop::IgnoredPattern
Expand Down Expand Up @@ -6571,6 +6598,53 @@ end

RuboCop::Cop::Naming::HeredocDelimiterNaming::MSG = T.let(T.unsafe(nil), String)

class RuboCop::Cop::Naming::InclusiveLanguage < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp

def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end

def on_new_investigation; end

private

def add_offenses_for_token(token, word_locations); end
def add_to_flagged_term_hash(regex_string, term, term_definition); end
def array_to_ignorecase_regex(strings); end
def check_token?(type); end
def create_message(word); end
def create_message_for_file(word); end
def create_multiple_word_message_for_file(words); end
def create_single_word_message_for_file(word); end
def ensure_regex_string(regex); end
def find_flagged_term(word); end
def format_suggestions(suggestions); end
def investigate_filepath; end
def investigate_tokens; end
def mask_input(str); end
def preprocess_check_config; end
def preprocess_flagged_terms; end
def preprocess_suggestions(suggestions); end
def process_allowed_regex(allowed); end
def scan_for_words(input); end
def set_regexes(flagged_term_strings, allowed_strings); end
end

RuboCop::Cop::Naming::InclusiveLanguage::EMPTY_ARRAY = T.let(T.unsafe(nil), Array)

class RuboCop::Cop::Naming::InclusiveLanguage::WordLocation < ::Struct
def position; end
def position=(_); end
def word; end
def word=(_); end

class << self
def [](*_arg0); end
def inspect; end
def members; end
def new(*_arg0); end
end
end

class RuboCop::Cop::Naming::MemoizedInstanceVariableName < ::RuboCop::Cop::Base
include ::RuboCop::Cop::ConfigurableEnforcedStyle

Expand Down Expand Up @@ -7625,6 +7699,7 @@ class RuboCop::Cop::Style::ClassAndModuleChildren < ::RuboCop::Cop::Base
def compact_node(corrector, node); end
def compact_node_name?(node); end
def compact_replacement(node); end
def configured_indentation_width; end
def indent_width; end
def leading_spaces(node); end
def needs_compacting?(body); end
Expand All @@ -7633,6 +7708,7 @@ class RuboCop::Cop::Style::ClassAndModuleChildren < ::RuboCop::Cop::Base
def remove_end(corrector, body); end
def replace_namespace_keyword(corrector, node); end
def split_on_double_colon(corrector, node, padding); end
def unindent(corrector, node); end
end

RuboCop::Cop::Style::ClassAndModuleChildren::COMPACT_MSG = T.let(T.unsafe(nil), String)
Expand Down Expand Up @@ -7818,13 +7894,18 @@ class RuboCop::Cop::Style::CommentAnnotation < ::RuboCop::Cop::Base
def annotation_range(comment, margin, first_word, colon, space); end
def concat_length(*args); end
def correct_annotation?(first_word, colon, space, note); end
def correct_colon_annotation?(first_word, colon, space, note); end
def correct_offense(corrector, range, first_word); end
def correct_space_annotation?(first_word, colon, space, note); end
def first_comment_line?(comments, index); end
def inline_comment?(comment); end
def register_offense(range, note, first_word); end
def requires_colon?; end
end

RuboCop::Cop::Style::CommentAnnotation::MISSING_NOTE = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::CommentAnnotation::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::CommentAnnotation::MSG_COLON_STYLE = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::CommentAnnotation::MSG_SPACE_STYLE = T.let(T.unsafe(nil), String)

class RuboCop::Cop::Style::CommentedKeyword < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
Expand Down Expand Up @@ -10577,6 +10658,7 @@ class RuboCop::Cop::Style::RegexpLiteral < ::RuboCop::Cop::Base
def allow_inner_slashes?; end
def allowed_mixed_percent_r?(node); end
def allowed_mixed_slash?(node); end
def allowed_omit_parentheses_with_percent_r_literal?(node); end
def allowed_percent_r_literal?(node); end
def allowed_slash_literal?(node); end
def calculate_replacement(node); end
Expand All @@ -10589,7 +10671,6 @@ class RuboCop::Cop::Style::RegexpLiteral < ::RuboCop::Cop::Base
def inner_slash_for(opening_delimiter); end
def inner_slash_indices(node); end
def node_body(node, include_begin_nodes: T.unsafe(nil)); end
def omit_parentheses_style?(node); end
def preferred_delimiters; end
def slash_literal?(node); end
end
Expand Down Expand Up @@ -10981,12 +11062,14 @@ class RuboCop::Cop::Style::StringConcatenation < ::RuboCop::Cop::Base

private

def collect_parts(node, parts); end
def collect_parts(node, parts = T.unsafe(nil)); end
def corrected_ancestor?(node); end
def find_topmost_plus_node(node); end
def handle_quotes(parts); end
def line_end_concatenation?(node); end
def offensive_for_mode?(receiver_node); end
def plus_node?(node); end
def register_offense(topmost_plus_node, parts); end
def replacement(parts); end
def single_quoted?(str_node); end
def uncorrectable?(part); end
Expand Down
1 change: 1 addition & 0 deletions Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
Expand Up @@ -26901,6 +26901,7 @@ end

module RuboCop::AST::NodePattern::Sets
SET_BEGINNING_OF_DAY_BEGINNING_OF_WEEK_BEGINNING_OF_MONTH_ETC = ::T.let(nil, ::T.untyped)
SET_BRANCH_REF_TAG = ::T.let(nil, ::T.untyped)
SET_BUILD_RECOMMENDED_TEST_OPTIONAL = ::T.let(nil, ::T.untyped)
SET_DEPENDS_ON_USES_FROM_MACOS = ::T.let(nil, ::T.untyped)
SET_END_OF_DAY_END_OF_WEEK_END_OF_MONTH_ETC = ::T.let(nil, ::T.untyped)
Expand Down
14 changes: 7 additions & 7 deletions Library/Homebrew/test/dev-cmd/audit_spec.rb
Expand Up @@ -293,7 +293,7 @@ class Foo < Formula
end

it "checks online and verifies that a standard license id is the same "\
"as what is indicated on its Github repo", :needs_network do
"as what is indicated on its Github repo", :needs_network do
formula_text = <<~RUBY
class Cask < Formula
url "https://github.com/cask/cask/archive/v0.8.4.tar.gz"
Expand All @@ -309,7 +309,7 @@ class Cask < Formula
end

it "checks online and verifies that a standard license id with AND is the same "\
"as what is indicated on its Github repo", :needs_network do
"as what is indicated on its Github repo", :needs_network do
formula_text = <<~RUBY
class Cask < Formula
url "https://github.com/cask/cask/archive/v0.8.4.tar.gz"
Expand All @@ -325,7 +325,7 @@ class Cask < Formula
end

it "checks online and verifies that a standard license id with WITH is the same "\
"as what is indicated on its Github repo", :needs_network do
"as what is indicated on its Github repo", :needs_network do
formula_text = <<~RUBY
class Cask < Formula
url "https://github.com/cask/cask/archive/v0.8.4.tar.gz"
Expand Down Expand Up @@ -407,7 +407,7 @@ class Cask < Formula
end

it "checks online and detects that a formula-specified license is not "\
"the same as what is indicated on its Github repository", :needs_network do
"the same as what is indicated on its Github repository", :needs_network do
formula_text = <<~RUBY
class Cask < Formula
url "https://github.com/cask/cask/archive/v0.8.4.tar.gz"
Expand Down Expand Up @@ -441,7 +441,7 @@ class Cask < Formula
end

it "checks online and detects that an array of license does not contain "\
"what is indicated on its Github repository", :needs_network do
"what is indicated on its Github repository", :needs_network do
formula_text = <<~RUBY
class Cask < Formula
url "https://github.com/cask/cask/archive/v0.8.4.tar.gz"
Expand All @@ -454,11 +454,11 @@ class Cask < Formula

fa.audit_license
expect(fa.problems.first[:message]).to match "Formula license [\"0BSD\", \"MIT\"] "\
"does not match GitHub license [\"GPL-3.0\"]."
"does not match GitHub license [\"GPL-3.0\"]."
end

it "checks online and verifies that an array of license contains "\
"what is indicated on its Github repository", :needs_network do
"what is indicated on its Github repository", :needs_network do
formula_text = <<~RUBY
class Cask < Formula
url "https://github.com/cask/cask/archive/v0.8.4.tar.gz"
Expand Down
Expand Up @@ -51,7 +51,7 @@
let(:expected_offenses) do
[{
message: "'https://foo.brew.sh' must have a slash "\
"after the domain.",
"after the domain.",
severity: :convention,
line: 2,
column: 11,
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/rubocops/cask/stanza_order_spec.rb
Expand Up @@ -110,7 +110,7 @@
line: 3,
column: 2,
source: "uninstall :quit => 'com.example.foo',\n" \
" :kext => 'com.example.foo.kext'",
" :kext => 'com.example.foo.kext'",
}, {
message: "`version` stanza out of order",
severity: :convention,
Expand Down