From 767c5086916216b37e5c9905eaac07449b79b4e7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Mar 2021 07:35:49 +0000 Subject: [PATCH 1/4] build(deps): bump rubocop from 1.11.0 to 1.12.0 in /Library/Homebrew Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.11.0 to 1.12.0. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.11.0...v1.12.0) Signed-off-by: dependabot[bot] --- Library/Homebrew/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index 123552b778..82f2d78539 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -108,7 +108,7 @@ GEM rspec-support (3.10.2) rspec-wait (0.0.9) rspec (>= 3, < 4) - rubocop (1.11.0) + rubocop (1.12.0) parallel (~> 1.10) parser (>= 3.0.0.0) rainbow (>= 2.2.2, < 4.0) From 5be95d1f86899e6a13414fe863f2dc5c55d20d20 Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Thu, 25 Mar 2021 07:40:28 +0000 Subject: [PATCH 2/4] brew vendor-gems: commit updates. --- Library/Homebrew/vendor/bundle/bundler/setup.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index e071316a36..338938505b 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -81,7 +81,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-wait-0.0.9/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-ast-1.4.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-progressbar-1.11.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unicode-display_width-2.0.0/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-1.11.0/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-1.12.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.10.2/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.9.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.2.0/lib" From 7f272b78758930fa927f24e512eaa4cfaff28f68 Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Thu, 25 Mar 2021 07:41:23 +0000 Subject: [PATCH 3/4] Update RBI files for rubocop. --- ...{rubocop@1.11.0.rbi => rubocop@1.12.0.rbi} | 265 ++++++++++++------ 1 file changed, 182 insertions(+), 83 deletions(-) rename Library/Homebrew/sorbet/rbi/gems/{rubocop@1.11.0.rbi => rubocop@1.12.0.rbi} (98%) diff --git a/Library/Homebrew/sorbet/rbi/gems/rubocop@1.11.0.rbi b/Library/Homebrew/sorbet/rbi/gems/rubocop@1.12.0.rbi similarity index 98% rename from Library/Homebrew/sorbet/rbi/gems/rubocop@1.11.0.rbi rename to Library/Homebrew/sorbet/rbi/gems/rubocop@1.12.0.rbi index 69c2cc7222..747eac7a95 100644 --- a/Library/Homebrew/sorbet/rbi/gems/rubocop@1.11.0.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/rubocop@1.12.0.rbi @@ -1,6 +1,6 @@ # DO NOT EDIT MANUALLY # This is an autogenerated file for types exported from the `rubocop` gem. -# Please instead update this file by running `tapioca sync`. +# Please instead update this file by running `bin/tapioca sync`. # typed: true @@ -184,33 +184,20 @@ class RuboCop::CommentConfig private - def all_cop_names; end def analyze; end - def analyze_cop(analysis, disabled, line, single_line); end - def analyze_disabled(analysis, line); end - def analyze_rest(analysis, line); end - def analyze_single_line(analysis, line, disabled); end + def analyze_cop(analysis, directive); end + def analyze_disabled(analysis, directive); end + def analyze_rest(analysis, directive); end + def analyze_single_line(analysis, directive); end def cop_line_ranges(analysis); end - def directive_on_comment_line?(comment); end - def directive_parts(comment); end def each_directive; end - def each_mentioned_cop; end - def enable_all?(comment); end def extra_enabled_comments_with_names(extras:, names:); end - def handle_enable_all(names, extras, comment); end - def handle_switch(cop_names, names, disabled, extras, comment); end + def handle_enable_all(directive, names, extras); end + def handle_switch(directive, names, extras); end def non_comment_token_line_numbers; end def qualified_cop_name(cop_name); end end -RuboCop::CommentConfig::COMMENT_DIRECTIVE_REGEXP = T.let(T.unsafe(nil), Regexp) - -RuboCop::CommentConfig::COPS_PATTERN = T.let(T.unsafe(nil), String) - -RuboCop::CommentConfig::COP_NAMES_PATTERN = T.let(T.unsafe(nil), String) - -RuboCop::CommentConfig::COP_NAME_PATTERN = T.let(T.unsafe(nil), String) - class RuboCop::CommentConfig::CopAnalysis < ::Struct def line_ranges; end def line_ranges=(_); end @@ -225,8 +212,6 @@ class RuboCop::CommentConfig::CopAnalysis < ::Struct end end -RuboCop::CommentConfig::REDUNDANT_DISABLE = T.let(T.unsafe(nil), String) - class RuboCop::Config include(::RuboCop::PathUtil) include(::RuboCop::FileFinder) @@ -608,6 +593,7 @@ module RuboCop::Cop::Alignment def end_of_line_comment(line); end def indentation(node); end def offset(node); end + def register_offense(offense_node, message_node); end def within?(inner, outer); end end @@ -619,7 +605,7 @@ class RuboCop::Cop::AlignmentCorrector class << self def align_end(corrector, processed_source, node, align_to); end - def correct(processed_source, node, column_delta); end + def correct(corrector, processed_source, node, column_delta); end def processed_source; end private @@ -1811,12 +1797,12 @@ end module RuboCop::Cop::Layout end -class RuboCop::Cop::Layout::AccessModifierIndentation < ::RuboCop::Cop::Cop +class RuboCop::Cop::Layout::AccessModifierIndentation < ::RuboCop::Cop::Base include(::RuboCop::Cop::Alignment) include(::RuboCop::Cop::ConfigurableEnforcedStyle) include(::RuboCop::Cop::RangeHelp) + extend(::RuboCop::Cop::AutoCorrector) - def autocorrect(node); end def on_block(node); end def on_class(node); end def on_module(node); end @@ -1824,24 +1810,26 @@ class RuboCop::Cop::Layout::AccessModifierIndentation < ::RuboCop::Cop::Cop private + def autocorrect(corrector, node); end def check_body(body, node); end def check_modifier(send_node, end_range); end def expected_indent_offset; end - def message(node); end + def message(range); end def unexpected_indent_offset; end end RuboCop::Cop::Layout::AccessModifierIndentation::MSG = T.let(T.unsafe(nil), String) -class RuboCop::Cop::Layout::ArgumentAlignment < ::RuboCop::Cop::Cop +class RuboCop::Cop::Layout::ArgumentAlignment < ::RuboCop::Cop::Base include(::RuboCop::Cop::Alignment) + extend(::RuboCop::Cop::AutoCorrector) - def autocorrect(node); end def on_csend(node); end def on_send(node); end private + def autocorrect(corrector, node); end def base_column(node, args); end def fixed_indentation?; end def message(_node); end @@ -1852,17 +1840,18 @@ RuboCop::Cop::Layout::ArgumentAlignment::ALIGN_PARAMS_MSG = T.let(T.unsafe(nil), RuboCop::Cop::Layout::ArgumentAlignment::FIXED_INDENT_MSG = T.let(T.unsafe(nil), String) -class RuboCop::Cop::Layout::ArrayAlignment < ::RuboCop::Cop::Cop +class RuboCop::Cop::Layout::ArrayAlignment < ::RuboCop::Cop::Base include(::RuboCop::Cop::Alignment) + extend(::RuboCop::Cop::AutoCorrector) - def autocorrect(node); end def on_array(node); end private + def autocorrect(corrector, node); end def base_column(node, args); end def fixed_indentation?; end - def message(_node); end + def message(_range); end def target_method_lineno(node); end end @@ -1870,11 +1859,15 @@ RuboCop::Cop::Layout::ArrayAlignment::ALIGN_ELEMENTS_MSG = T.let(T.unsafe(nil), RuboCop::Cop::Layout::ArrayAlignment::FIXED_INDENT_MSG = T.let(T.unsafe(nil), String) -class RuboCop::Cop::Layout::AssignmentIndentation < ::RuboCop::Cop::Cop +class RuboCop::Cop::Layout::AssignmentIndentation < ::RuboCop::Cop::Base include(::RuboCop::Cop::CheckAssignment) include(::RuboCop::Cop::Alignment) + extend(::RuboCop::Cop::AutoCorrector) - def autocorrect(node); end + + private + + def autocorrect(corrector, node); end def check_assignment(node, rhs); end def leftmost_multiple_assignment(node); end end @@ -1928,10 +1921,10 @@ end RuboCop::Cop::Layout::BlockAlignment::MSG = T.let(T.unsafe(nil), String) -class RuboCop::Cop::Layout::BlockEndNewline < ::RuboCop::Cop::Cop +class RuboCop::Cop::Layout::BlockEndNewline < ::RuboCop::Cop::Base include(::RuboCop::Cop::Alignment) + extend(::RuboCop::Cop::AutoCorrector) - def autocorrect(node); end def on_block(node); end private @@ -2020,10 +2013,10 @@ RuboCop::Cop::Layout::ClosingHeredocIndentation::MSG_ARG = T.let(T.unsafe(nil), RuboCop::Cop::Layout::ClosingHeredocIndentation::SIMPLE_HEREDOC = T.let(T.unsafe(nil), String) -class RuboCop::Cop::Layout::ClosingParenthesisIndentation < ::RuboCop::Cop::Cop +class RuboCop::Cop::Layout::ClosingParenthesisIndentation < ::RuboCop::Cop::Base include(::RuboCop::Cop::Alignment) + extend(::RuboCop::Cop::AutoCorrector) - def autocorrect(node); end def on_begin(node); end def on_csend(node); end def on_def(node); end @@ -2033,6 +2026,7 @@ class RuboCop::Cop::Layout::ClosingParenthesisIndentation < ::RuboCop::Cop::Cop private def all_elements_aligned?(elements); end + def autocorrect(corrector, node); end def check(node, elements); end def check_for_elements(node, elements); end def check_for_no_elements(node); end @@ -2048,16 +2042,17 @@ RuboCop::Cop::Layout::ClosingParenthesisIndentation::MSG_ALIGN = T.let(T.unsafe( RuboCop::Cop::Layout::ClosingParenthesisIndentation::MSG_INDENT = T.let(T.unsafe(nil), String) -class RuboCop::Cop::Layout::CommentIndentation < ::RuboCop::Cop::Cop +class RuboCop::Cop::Layout::CommentIndentation < ::RuboCop::Cop::Base include(::RuboCop::Cop::Alignment) + extend(::RuboCop::Cop::AutoCorrector) - def autocorrect(comment); end - def investigate(processed_source); end + def on_new_investigation; end private - def autocorrect_one(comment); end - def autocorrect_preceding_comments(comment); end + def autocorrect(corrector, comment); end + def autocorrect_one(corrector, comment); end + def autocorrect_preceding_comments(corrector, comment); end def check(comment); end def correct_indentation(next_line); end def less_indented?(line); end @@ -2121,14 +2116,14 @@ class RuboCop::Cop::Layout::DotPosition < ::RuboCop::Cop::Base def selector_range(node); end end -class RuboCop::Cop::Layout::ElseAlignment < ::RuboCop::Cop::Cop +class RuboCop::Cop::Layout::ElseAlignment < ::RuboCop::Cop::Base include(::RuboCop::Cop::ConfigurableEnforcedStyle) include(::RuboCop::Cop::RangeHelp) include(::RuboCop::Cop::EndKeywordAlignment) include(::RuboCop::Cop::Alignment) include(::RuboCop::Cop::CheckAssignment) + extend(::RuboCop::Cop::AutoCorrector) - def autocorrect(node); end def on_case(node); end def on_case_match(node); end def on_if(node, base = T.unsafe(nil)); end @@ -2137,6 +2132,7 @@ class RuboCop::Cop::Layout::ElseAlignment < ::RuboCop::Cop::Cop private def assignment_node(node); end + def autocorrect(corrector, node); end def base_for_method_definition(node); end def base_range_of_if(node, base); end def base_range_of_rescue(node); end @@ -2559,12 +2555,12 @@ RuboCop::Cop::Layout::ExtraSpacing::MSG_UNALIGNED_ASGN = T.let(T.unsafe(nil), St RuboCop::Cop::Layout::ExtraSpacing::MSG_UNNECESSARY = T.let(T.unsafe(nil), String) -class RuboCop::Cop::Layout::FirstArgumentIndentation < ::RuboCop::Cop::Cop +class RuboCop::Cop::Layout::FirstArgumentIndentation < ::RuboCop::Cop::Base include(::RuboCop::Cop::Alignment) include(::RuboCop::Cop::ConfigurableEnforcedStyle) include(::RuboCop::Cop::RangeHelp) + extend(::RuboCop::Cop::AutoCorrector) - def autocorrect(node); end def eligible_method_call?(param0 = T.unsafe(nil)); end def on_csend(node); end def on_send(node); end @@ -2572,6 +2568,7 @@ class RuboCop::Cop::Layout::FirstArgumentIndentation < ::RuboCop::Cop::Cop private def argument_alignment_config; end + def autocorrect(corrector, node); end def bare_operator?(node); end def base_indentation(node); end def base_range(send_node, arg_node); end @@ -2586,18 +2583,19 @@ end RuboCop::Cop::Layout::FirstArgumentIndentation::MSG = T.let(T.unsafe(nil), String) -class RuboCop::Cop::Layout::FirstArrayElementIndentation < ::RuboCop::Cop::Cop +class RuboCop::Cop::Layout::FirstArrayElementIndentation < ::RuboCop::Cop::Base include(::RuboCop::Cop::Alignment) include(::RuboCop::Cop::ConfigurableEnforcedStyle) include(::RuboCop::Cop::MultilineElementIndentation) + extend(::RuboCop::Cop::AutoCorrector) - def autocorrect(node); end def on_array(node); end def on_csend(node); end def on_send(node); end private + def autocorrect(corrector, node); end def base_description(left_parenthesis); end def brace_alignment_style; end def check(array_node, left_parenthesis); end @@ -2621,24 +2619,26 @@ end RuboCop::Cop::Layout::FirstArrayElementLineBreak::MSG = T.let(T.unsafe(nil), String) -class RuboCop::Cop::Layout::FirstHashElementIndentation < ::RuboCop::Cop::Cop +class RuboCop::Cop::Layout::FirstHashElementIndentation < ::RuboCop::Cop::Base include(::RuboCop::Cop::Alignment) include(::RuboCop::Cop::ConfigurableEnforcedStyle) include(::RuboCop::Cop::MultilineElementIndentation) + extend(::RuboCop::Cop::AutoCorrector) - def autocorrect(node); end def on_csend(node); end def on_hash(node); end def on_send(node); end private + def autocorrect(corrector, node); end def base_description(left_parenthesis); end def brace_alignment_style; end def check(hash_node, left_parenthesis); end def check_based_on_longest_key(hash_node, left_brace, left_parenthesis); end def check_right_brace(right_brace, left_brace, left_parenthesis); end def message(base_description); end + def message_for_right_brace(left_parenthesis); end def separator_style?(first_pair); end end @@ -2674,17 +2674,18 @@ end RuboCop::Cop::Layout::FirstMethodParameterLineBreak::MSG = T.let(T.unsafe(nil), String) -class RuboCop::Cop::Layout::FirstParameterIndentation < ::RuboCop::Cop::Cop +class RuboCop::Cop::Layout::FirstParameterIndentation < ::RuboCop::Cop::Base include(::RuboCop::Cop::Alignment) include(::RuboCop::Cop::ConfigurableEnforcedStyle) include(::RuboCop::Cop::MultilineElementIndentation) + extend(::RuboCop::Cop::AutoCorrector) - def autocorrect(node); end def on_def(node); end def on_defs(node); end private + def autocorrect(corrector, node); end def base_description(_); end def brace_alignment_style; end def check(def_node); end @@ -2801,16 +2802,17 @@ RuboCop::Cop::Layout::HeredocIndentation::TYPE_MSG = T.let(T.unsafe(nil), String RuboCop::Cop::Layout::HeredocIndentation::WIDTH_MSG = T.let(T.unsafe(nil), String) -class RuboCop::Cop::Layout::IndentationConsistency < ::RuboCop::Cop::Cop +class RuboCop::Cop::Layout::IndentationConsistency < ::RuboCop::Cop::Base include(::RuboCop::Cop::Alignment) include(::RuboCop::Cop::ConfigurableEnforcedStyle) + extend(::RuboCop::Cop::AutoCorrector) - def autocorrect(node); end def on_begin(node); end def on_kwbegin(node); end private + def autocorrect(corrector, node); end def bare_access_modifier?(node); end def base_column_for_normal_style(node); end def check(node); end @@ -2820,19 +2822,20 @@ end RuboCop::Cop::Layout::IndentationConsistency::MSG = T.let(T.unsafe(nil), String) -class RuboCop::Cop::Layout::IndentationStyle < ::RuboCop::Cop::Cop +class RuboCop::Cop::Layout::IndentationStyle < ::RuboCop::Cop::Base include(::RuboCop::Cop::Alignment) include(::RuboCop::Cop::ConfigurableEnforcedStyle) include(::RuboCop::Cop::RangeHelp) + extend(::RuboCop::Cop::AutoCorrector) - def autocorrect(range); end - def investigate(processed_source); end + def on_new_investigation; end private - def autocorrect_lambda_for_spaces(range); end - def autocorrect_lambda_for_tabs(range); end - def find_offence(line); end + def autocorrect(corrector, range); end + def autocorrect_lambda_for_spaces(corrector, range); end + def autocorrect_lambda_for_tabs(corrector, range); end + def find_offence(line, lineno); end def in_string_literal?(ranges, tabs_range); end def message(_node); end def string_literal_ranges(ast); end @@ -2840,16 +2843,16 @@ end RuboCop::Cop::Layout::IndentationStyle::MSG = T.let(T.unsafe(nil), String) -class RuboCop::Cop::Layout::IndentationWidth < ::RuboCop::Cop::Cop +class RuboCop::Cop::Layout::IndentationWidth < ::RuboCop::Cop::Base include(::RuboCop::Cop::ConfigurableEnforcedStyle) include(::RuboCop::Cop::RangeHelp) include(::RuboCop::Cop::EndKeywordAlignment) include(::RuboCop::Cop::Alignment) include(::RuboCop::Cop::CheckAssignment) include(::RuboCop::Cop::IgnoredPattern) + extend(::RuboCop::Cop::AutoCorrector) def access_modifier?(param0 = T.unsafe(nil)); end - def autocorrect(node); end def on_block(node); end def on_case(case_node); end def on_class(node); end @@ -2871,12 +2874,14 @@ class RuboCop::Cop::Layout::IndentationWidth < ::RuboCop::Cop::Cop private def access_modifier_indentation_style; end + def autocorrect(corrector, node); end def check_assignment(node, rhs); end def check_if(node, body, else_clause, base_loc); end def check_indentation(base_loc, body_node, style = T.unsafe(nil)); end def check_members(base, members); end def check_members_for_indented_internal_methods_style(members); end def check_members_for_normal_style(base, members); end + def check_rescue?(rescue_node); end def configured_indentation_width; end def each_member(members); end def indentation_consistency_style; end @@ -3116,18 +3121,19 @@ RuboCop::Cop::Layout::MultilineMethodCallBraceLayout::NEW_LINE_MESSAGE = T.let(T RuboCop::Cop::Layout::MultilineMethodCallBraceLayout::SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) -class RuboCop::Cop::Layout::MultilineMethodCallIndentation < ::RuboCop::Cop::Cop +class RuboCop::Cop::Layout::MultilineMethodCallIndentation < ::RuboCop::Cop::Base include(::RuboCop::Cop::ConfigurableEnforcedStyle) include(::RuboCop::Cop::Alignment) include(::RuboCop::Cop::MultilineExpressionIndentation) + extend(::RuboCop::Cop::AutoCorrector) - def autocorrect(node); end def validate_config; end private def align_with_base_message(rhs); end def alignment_base(node, rhs, given_style); end + def autocorrect(corrector, node); end def base_source; end def extra_indentation(given_style, parent); end def message(node, lhs, rhs); end @@ -3162,18 +3168,19 @@ RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout::NEW_LINE_MESSAGE = T RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout::SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) -class RuboCop::Cop::Layout::MultilineOperationIndentation < ::RuboCop::Cop::Cop +class RuboCop::Cop::Layout::MultilineOperationIndentation < ::RuboCop::Cop::Base include(::RuboCop::Cop::ConfigurableEnforcedStyle) include(::RuboCop::Cop::Alignment) include(::RuboCop::Cop::MultilineExpressionIndentation) + extend(::RuboCop::Cop::AutoCorrector) - def autocorrect(node); end def on_and(node); end def on_or(node); end def validate_config; end private + def autocorrect(corrector, node); end def check_and_or(node); end def message(node, lhs, rhs); end def offending_range(node, lhs, rhs, given_style); end @@ -3181,15 +3188,16 @@ class RuboCop::Cop::Layout::MultilineOperationIndentation < ::RuboCop::Cop::Cop def should_align?(node, rhs, given_style); end end -class RuboCop::Cop::Layout::ParameterAlignment < ::RuboCop::Cop::Cop +class RuboCop::Cop::Layout::ParameterAlignment < ::RuboCop::Cop::Base include(::RuboCop::Cop::Alignment) + extend(::RuboCop::Cop::AutoCorrector) - def autocorrect(node); end def on_def(node); end def on_defs(node); end private + def autocorrect(corrector, node); end def base_column(node, args); end def fixed_indentation?; end def message(_node); end @@ -4810,6 +4818,7 @@ class RuboCop::Cop::Lint::NumberConversion < ::RuboCop::Cop::Base def ignore_receiver?(receiver); end def ignored_class?(name); end def ignored_classes; end + def remove_parentheses(corrector, node); end def top_receiver(node); end end @@ -5377,28 +5386,36 @@ class RuboCop::Cop::Lint::SuppressedException < ::RuboCop::Cop::Base private def comment_between_rescue_and_end?(node); end + def nil_body?(node); end end RuboCop::Cop::Lint::SuppressedException::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::Lint::SymbolConversion < ::RuboCop::Cop::Base + include(::RuboCop::Cop::ConfigurableEnforcedStyle) extend(::RuboCop::Cop::AutoCorrector) + def on_hash(node); end def on_send(node); end def on_sym(node); end private def correct_hash_key(node); end + def correct_inconsistent_hash_keys(keys); end def hash_key?(node); end def in_alias?(node); end def in_percent_literal_array?(node); end def properly_quoted?(source, value); end + def quote_type; end def register_offense(node, correction:, message: T.unsafe(nil)); end + def requires_quotes?(sym_node); end end RuboCop::Cop::Lint::SymbolConversion::MSG = T.let(T.unsafe(nil), String) +RuboCop::Cop::Lint::SymbolConversion::MSG_CONSISTENCY = T.let(T.unsafe(nil), String) + RuboCop::Cop::Lint::SymbolConversion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) class RuboCop::Cop::Lint::Syntax < ::RuboCop::Cop::Base @@ -6783,6 +6800,7 @@ class RuboCop::Cop::Registry def ==(other); end def contains_cop_matching?(names); end def cops; end + def department?(name); end def department_missing?(badge, name); end def departments; end def dismiss(cop); end @@ -6795,6 +6813,7 @@ class RuboCop::Cop::Registry def freeze; end def length; end def names; end + def names_for_department(department); end def options; end def print_warning(name, path); end def qualified_cop_name(name, path, warn: T.unsafe(nil)); end @@ -7263,28 +7282,50 @@ end RuboCop::Cop::Style::BeginBlock::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::Style::BisectedAttrAccessor < ::RuboCop::Cop::Base - include(::RuboCop::Cop::VisibilityHelp) + include(::RuboCop::Cop::RangeHelp) extend(::RuboCop::Cop::AutoCorrector) + def after_class(class_node); end + def after_module(class_node); end + def after_sclass(class_node); end def on_class(class_node); end def on_module(class_node); end + def on_new_investigation; end def on_sclass(class_node); end private - def accessor_macroses(class_node, visibility); end - def accessor_names(class_node, visibility); end - def attr_reader?(send_node); end - def attr_reader_replacement(macro, node, rest_args); end - def attr_within_visibility_scope?(node, visibility); end - def attr_writer?(send_node); end - def check(macro, reader_names, writer_names); end - def replacement(macro, node); end - def rest_args(args, reader_names, writer_names); end + def correct_reader(corrector, macro, node, range); end + def correct_writer(corrector, macro, node, range); end + def find_bisection(macros); end + def find_macros(class_def); end + def register_offense(attr); end end RuboCop::Cop::Style::BisectedAttrAccessor::MSG = T.let(T.unsafe(nil), String) +class RuboCop::Cop::Style::BisectedAttrAccessor::Macro + include(::RuboCop::Cop::VisibilityHelp) + + def initialize(node); end + + def all_bisected?; end + def attr_names; end + def attrs; end + def bisect(*names); end + def bisected_names; end + def bisection; end + def node; end + def reader?; end + def rest; end + def visibility; end + def writer?; end + + class << self + def macro?(node); end + end +end + class RuboCop::Cop::Style::BlockComments < ::RuboCop::Cop::Base include(::RuboCop::Cop::RangeHelp) extend(::RuboCop::Cop::AutoCorrector) @@ -7395,6 +7436,7 @@ class RuboCop::Cop::Style::CaseLikeIf < ::RuboCop::Cop::Base def collect_conditions(node, target, conditions); end def condition_from_binary_op(lhs, rhs, target); end def condition_from_equality_node(node, target); end + def condition_from_include_or_cover_node(node, target); end def condition_from_match_node(node, target); end def condition_from_send_node(node, target); end def const_reference?(node); end @@ -7402,6 +7444,7 @@ class RuboCop::Cop::Style::CaseLikeIf < ::RuboCop::Cop::Base def deparenthesize(node); end def find_target(node); end def find_target_in_equality_node(node); end + def find_target_in_include_or_cover_node(node); end def find_target_in_match_node(node); end def find_target_in_send_node(node); end def regexp_with_named_captures?(node); end @@ -7907,14 +7950,17 @@ class RuboCop::Cop::Style::Documentation < ::RuboCop::Cop::Base private + def allowed_constants; end def check(node, body, type); end def compact_namespace?(node); end + def constant_allowed?(node); end def constant_declaration?(node); end def macro_only?(body); end def namespace?(node); end def nodoc(node); end def nodoc?(comment, require_all: T.unsafe(nil)); end def nodoc_comment?(node, require_all: T.unsafe(nil)); end + def nodoc_self_or_outer_module?(node); end end RuboCop::Cop::Style::Documentation::MSG = T.let(T.unsafe(nil), String) @@ -8552,12 +8598,12 @@ end RuboCop::Cop::Style::HashLikeCase::MSG = T.let(T.unsafe(nil), String) -class RuboCop::Cop::Style::HashSyntax < ::RuboCop::Cop::Cop +class RuboCop::Cop::Style::HashSyntax < ::RuboCop::Cop::Base include(::RuboCop::Cop::ConfigurableEnforcedStyle) include(::RuboCop::Cop::RangeHelp) + extend(::RuboCop::Cop::AutoCorrector) def alternative_style; end - def autocorrect(node); end def hash_rockets_check(pairs); end def no_mixed_keys_check(pairs); end def on_hash(node); end @@ -8568,6 +8614,7 @@ class RuboCop::Cop::Style::HashSyntax < ::RuboCop::Cop::Cop def acceptable_19_syntax_symbol?(sym_name); end def argument_without_space?(node); end + def autocorrect(corrector, node); end def autocorrect_hash_rockets(corrector, pair_node); end def autocorrect_no_mixed_keys(corrector, pair_node); end def autocorrect_ruby19(corrector, pair_node); end @@ -8976,6 +9023,7 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses def allowed_camel_case_method_call?(node); end def allowed_chained_call_with_parentheses?(node); end def allowed_multiline_call_with_parentheses?(node); end + def allowed_string_interpolation_method_call?(node); end def ambigious_literal?(node); end def assigned_before?(node, target); end def auto_correct(corrector, node); end @@ -8989,6 +9037,7 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses def hash_literal?(node); end def hash_literal_in_arguments?(node); end def inside_endless_method_def?(node); end + def inside_string_interpolation?(node); end def legitimate_call_with_parentheses?(node); end def logical_operator?(node); end def offense_range(node); end @@ -8997,6 +9046,7 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses def regexp_slash_literal?(node); end def splat?(node); end def super_call_without_arguments?(node); end + def syntax_like_method_call?(node); end def ternary_if?(node); end def unary_literal?(node); end end @@ -9350,6 +9400,8 @@ end class RuboCop::Cop::Style::NegatedIfElseCondition < ::RuboCop::Cop::Base include(::RuboCop::Cop::RangeHelp) + include(::RuboCop::Cop::VisibilityHelp) + include(::RuboCop::Cop::CommentsHelp) extend(::RuboCop::Cop::AutoCorrector) def double_negation?(param0 = T.unsafe(nil)); end @@ -9362,6 +9414,7 @@ class RuboCop::Cop::Style::NegatedIfElseCondition < ::RuboCop::Cop::Base def corrected_ancestor?(node); end def if_else?(node); end def negated_condition?(node); end + def node_with_comments(node); end def swap_branches(corrector, node); end class << self @@ -10014,6 +10067,7 @@ end RuboCop::Cop::Style::RedundantAssignment::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::Style::RedundantBegin < ::RuboCop::Cop::Base + include(::RuboCop::Cop::RangeHelp) extend(::RuboCop::Cop::AutoCorrector) def on_block(node); end @@ -10023,9 +10077,12 @@ class RuboCop::Cop::Style::RedundantBegin < ::RuboCop::Cop::Base private + def any_ancestor_assignment_node?(node); end def contain_rescue_or_ensure?(node); end def empty_begin?(node); end def register_offense(node); end + def replace_begin_with_statement(corrector, offense_range, node); end + def valid_begin_assignment?(node); end def valid_context_using_only_begin?(node); end end @@ -10471,16 +10528,17 @@ RuboCop::Cop::Style::RegexpLiteral::MSG_USE_PERCENT_R = T.let(T.unsafe(nil), Str RuboCop::Cop::Style::RegexpLiteral::MSG_USE_SLASHES = T.let(T.unsafe(nil), String) -class RuboCop::Cop::Style::RescueModifier < ::RuboCop::Cop::Cop +class RuboCop::Cop::Style::RescueModifier < ::RuboCop::Cop::Base include(::RuboCop::Cop::Alignment) + include(::RuboCop::Cop::RangeHelp) include(::RuboCop::Cop::RescueNode) + extend(::RuboCop::Cop::AutoCorrector) - def autocorrect(node); end def on_resbody(node); end private - def corrected_block(node, parenthesized); end + def correct_rescue_block(corrector, node, parenthesized); end def indentation_and_offset(node, parenthesized); end def parenthesized?(node); end end @@ -10744,6 +10802,7 @@ class RuboCop::Cop::Style::SoleNestedConditional < ::RuboCop::Cop::Base def allow_modifier?; end def arguments_range(node); end + def assigned_variables(condition); end def autocorrect(corrector, node, if_branch); end def correct_for_basic_condition_style(corrector, node, if_branch, and_operator); end def correct_for_comment(corrector, node, if_branch); end @@ -10752,6 +10811,7 @@ class RuboCop::Cop::Style::SoleNestedConditional < ::RuboCop::Cop::Base def offending_branch?(branch); end def replacement_condition(and_operator, condition); end def requrie_parentheses?(condition); end + def use_variable_assignment_in_condition?(condition, if_branch); end def wrap_condition?(node); end end @@ -10841,6 +10901,18 @@ RuboCop::Cop::Style::StderrPuts::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::StderrPuts::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) +class RuboCop::Cop::Style::StringChars < ::RuboCop::Cop::Base + extend(::RuboCop::Cop::AutoCorrector) + + def on_send(node); end +end + +RuboCop::Cop::Style::StringChars::BAD_ARGUMENTS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Style::StringChars::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::StringChars::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + class RuboCop::Cop::Style::StringConcatenation < ::RuboCop::Cop::Base extend(::RuboCop::Cop::AutoCorrector) @@ -12046,12 +12118,39 @@ RuboCop::Cop::VisibilityHelp::VISIBILITY_SCOPES = T.let(T.unsafe(nil), Array) class RuboCop::DirectiveComment def initialize(comment); end + def all_cops?; end def comment; end + def cop_names; end def cops; end + def disabled?; end + def enabled_all?; end + def line_number; end def match?(cop_names); end + def match_captures; end + def mode; end def range; end + def single_line?; end + + private + + def all_cop_names; end + def parsed_cop_names; end + + class << self + def before_comment(line); end + end end +RuboCop::DirectiveComment::COPS_PATTERN = T.let(T.unsafe(nil), String) + +RuboCop::DirectiveComment::COP_NAMES_PATTERN = T.let(T.unsafe(nil), String) + +RuboCop::DirectiveComment::COP_NAME_PATTERN = T.let(T.unsafe(nil), String) + +RuboCop::DirectiveComment::DIRECTIVE_COMMENT_REGEXP = T.let(T.unsafe(nil), Regexp) + +RuboCop::DirectiveComment::REDUNDANT_COP = T.let(T.unsafe(nil), String) + class RuboCop::Error < ::StandardError end From 450bc4ab337f19382e0fbc0fd8ef5879deb8c489 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Fri, 26 Mar 2021 14:11:03 +0000 Subject: [PATCH 4/4] Fix `brew style` --- Library/Homebrew/cask_dependent.rb | 6 ++--- Library/Homebrew/cleanup.rb | 8 +++--- Library/Homebrew/development_tools.rb | 25 ++++++++----------- Library/Homebrew/os/mac/mach.rb | 4 +-- Library/Homebrew/os/mac/sdk.rb | 10 +++----- .../Homebrew/rubocops/cask/ast/cask_header.rb | 10 +++----- .../Homebrew/rubocops/shared/desc_helper.rb | 2 +- Library/Homebrew/utils/github/api.rb | 4 +-- 8 files changed, 27 insertions(+), 42 deletions(-) diff --git a/Library/Homebrew/cask_dependent.rb b/Library/Homebrew/cask_dependent.rb index a372401690..e1c4bcd52e 100644 --- a/Library/Homebrew/cask_dependent.rb +++ b/Library/Homebrew/cask_dependent.rb @@ -20,10 +20,8 @@ class CaskDependent end def deps - @deps ||= begin - @cask.depends_on.formula.map do |f| - Dependency.new f - end + @deps ||= @cask.depends_on.formula.map do |f| + Dependency.new f end end diff --git a/Library/Homebrew/cleanup.rb b/Library/Homebrew/cleanup.rb index e205ebd3bc..5c8ae73474 100644 --- a/Library/Homebrew/cleanup.rb +++ b/Library/Homebrew/cleanup.rb @@ -430,11 +430,9 @@ module Homebrew end def rm_ds_store(dirs = nil) - dirs ||= begin - Keg::MUST_EXIST_DIRECTORIES + [ - HOMEBREW_PREFIX/"Caskroom", - ] - end + dirs ||= Keg::MUST_EXIST_DIRECTORIES + [ + HOMEBREW_PREFIX/"Caskroom", + ] dirs.select(&:directory?) .flat_map { |d| Pathname.glob("#{d}/**/.DS_Store") } .each(&:unlink) diff --git a/Library/Homebrew/development_tools.rb b/Library/Homebrew/development_tools.rb index 33f4cddc8e..14fd4388ec 100644 --- a/Library/Homebrew/development_tools.rb +++ b/Library/Homebrew/development_tools.rb @@ -41,24 +41,21 @@ class DevelopmentTools end def clang_version - @clang_version ||= begin - if (path = locate("clang")) && - (build_version = `#{path} --version`[/(?:clang|LLVM) version (\d+\.\d)/, 1]) - Version.new build_version - else - Version::NULL - end + @clang_version ||= if (path = locate("clang")) && + (build_version = `#{path} --version`[/(?:clang|LLVM) version (\d+\.\d)/, 1]) + Version.new build_version + else + Version::NULL end end def clang_build_version - @clang_build_version ||= begin - if (path = locate("clang")) && - (build_version = `#{path} --version`[%r{clang(-| version [^ ]+ \(tags/RELEASE_)(\d{2,})}, 2]) - Version.new build_version - else - Version::NULL - end + @clang_build_version ||= if (path = locate("clang")) && + (build_version = `#{path} --version`[ +%r{clang(-| version [^ ]+ \(tags/RELEASE_)(\d{2,})}, 2]) + Version.new build_version + else + Version::NULL end end diff --git a/Library/Homebrew/os/mac/mach.rb b/Library/Homebrew/os/mac/mach.rb index ff0b1c74c3..f0e6e30d30 100644 --- a/Library/Homebrew/os/mac/mach.rb +++ b/Library/Homebrew/os/mac/mach.rb @@ -13,9 +13,7 @@ module MachOShim delegate [:dylib_id, :rpaths, :delete_rpath] => :macho def macho - @macho ||= begin - MachO.open(to_s) - end + @macho ||= MachO.open(to_s) end private :macho diff --git a/Library/Homebrew/os/mac/sdk.rb b/Library/Homebrew/os/mac/sdk.rb index f39d9e527d..164c095b09 100644 --- a/Library/Homebrew/os/mac/sdk.rb +++ b/Library/Homebrew/os/mac/sdk.rb @@ -170,12 +170,10 @@ module OS # This will only look up SDKs on Xcode 10 or newer, and still # return nil SDKs for Xcode 9 and older. def sdk_prefix - @sdk_prefix ||= begin - if CLT.provides_sdk? - "#{CLT::PKG_PATH}/SDKs" - else - "" - end + @sdk_prefix ||= if CLT.provides_sdk? + "#{CLT::PKG_PATH}/SDKs" + else + "" end end end diff --git a/Library/Homebrew/rubocops/cask/ast/cask_header.rb b/Library/Homebrew/rubocops/cask/ast/cask_header.rb index addb8a718c..01386a4667 100644 --- a/Library/Homebrew/rubocops/cask/ast/cask_header.rb +++ b/Library/Homebrew/rubocops/cask/ast/cask_header.rb @@ -33,12 +33,10 @@ module RuboCop end def cask_token - @cask_token ||= begin - if dsl_version? - pair_node.val_node.children.first - else - method_node.first_argument.str_content - end + @cask_token ||= if dsl_version? + pair_node.val_node.children.first + else + method_node.first_argument.str_content end end diff --git a/Library/Homebrew/rubocops/shared/desc_helper.rb b/Library/Homebrew/rubocops/shared/desc_helper.rb index 4ca9d5f9f1..f095efd8a8 100644 --- a/Library/Homebrew/rubocops/shared/desc_helper.rb +++ b/Library/Homebrew/rubocops/shared/desc_helper.rb @@ -59,7 +59,7 @@ module RuboCop end # Check if the desc starts with the formula's or cask's name. - name_regex = name.delete("-").split("").join('[\s\-]?') + name_regex = name.delete("-").chars.join('[\s\-]?') if regex_match_group(desc, /^#{name_regex}\b/i) desc_problem "Description shouldn't start with the #{type} name." end diff --git a/Library/Homebrew/utils/github/api.rb b/Library/Homebrew/utils/github/api.rb index 6653c51376..3407fb2a10 100644 --- a/Library/Homebrew/utils/github/api.rb +++ b/Library/Homebrew/utils/github/api.rb @@ -139,9 +139,7 @@ module GitHub end def credentials - @credentials ||= begin - Homebrew::EnvConfig.github_api_token || keychain_username_password - end + @credentials ||= Homebrew::EnvConfig.github_api_token || keychain_username_password end sig { returns(Symbol) }