Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rubygem-rubocop for openSUSE:Factory checked in at 2021-07-29 21:31:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-rubocop (Old) and /work/SRC/openSUSE:Factory/.rubygem-rubocop.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-rubocop" Thu Jul 29 21:31:57 2021 rev:28 rq:909130 version:1.18.4 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-rubocop/rubygem-rubocop.changes 2021-07-12 01:25:32.708996709 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-rubocop.new.1899/rubygem-rubocop.changes 2021-07-29 21:33:04.668688770 +0200 @@ -1,0 +2,21 @@ +Thu Jul 29 09:42:06 UTC 2021 - Manuel Schnitzer <mschnit...@suse.com> + +- updated to version 1.18.4 + + ### New features + + * [#9930](https://github.com/rubocop/rubocop/pull/9930): Support Ruby 2.7's pattern matching for `Lint/DuplicateBranch` cop. ([@koic][]) + + ### Bug fixes + + * [#9938](https://github.com/rubocop/rubocop/pull/9938): Fix an incorrect auto-correct for `Layout/LineLength` when a heredoc is used as the first element of an array. ([@koic][]) + * [#9940](https://github.com/rubocop/rubocop/issues/9940): Fix an incorrect auto-correct for `Style/HashTransformValues` when value is a hash literal for `_.to_h{...}`. ([@koic][]) + * [#9752](https://github.com/rubocop/rubocop/issues/9752): Improve error message for top level department used in configuration. ([@jonas054][]) + * [#9933](https://github.com/rubocop/rubocop/pull/9933): Fix GitHub Actions formatter when running in non-default directory. ([@ojab][]) + * [#9922](https://github.com/rubocop/rubocop/issues/9922): Make better auto-corrections in `Style/DoubleCopDisableDirective`. ([@jonas054][]) + * [#9848](https://github.com/rubocop/rubocop/issues/9848): Fix handling of comments in `Layout/ClassStructure` auto-correct. ([@jonas054][]) + * [#9926](https://github.com/rubocop/rubocop/pull/9926): Fix an incorrect auto-correct for `Style/SingleLineMethods` when method body is enclosed in parentheses. ([@koic][]) + * [#9928](https://github.com/rubocop/rubocop/issues/9928): Fix an infinite loop error and a false auto-correction behavior for `Layout/EndAlignment` when using operator methods and `EnforcedStyleAlignWith: variable`. ([@koic][]) + * [#9434](https://github.com/rubocop/rubocop/issues/9434): Fix false positive for setter calls in `Layout/FirstArgumentIndentation`. ([@jonas054][]) + +------------------------------------------------------------------- Old: ---- rubocop-1.18.3.gem New: ---- rubocop-1.18.4.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-rubocop.spec ++++++ --- /var/tmp/diff_new_pack.P6sI8m/_old 2021-07-29 21:33:05.052688298 +0200 +++ /var/tmp/diff_new_pack.P6sI8m/_new 2021-07-29 21:33:05.056688292 +0200 @@ -24,7 +24,7 @@ # Name: rubygem-rubocop -Version: 1.18.3 +Version: 1.18.4 Release: 0 %define mod_name rubocop %define mod_full_name %{mod_name}-%{version} ++++++ rubocop-1.18.3.gem -> rubocop-1.18.4.gem ++++++ Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rubocop/config_validator.rb new/lib/rubocop/config_validator.rb --- old/lib/rubocop/config_validator.rb 2021-07-06 11:14:54.000000000 +0200 +++ new/lib/rubocop/config_validator.rb 2021-07-23 08:12:25.000000000 +0200 @@ -104,12 +104,9 @@ # to do so than to pass the value around to various methods. next if name == 'inherit_mode' - suggestions = NameSimilarity.find_similar_names(name, Cop::Registry.global.map(&:cop_name)) - suggestion = "Did you mean `#{suggestions.join('`, `')}`?" if suggestions.any? - message = <<~MESSAGE.rstrip - unrecognized cop #{name} found in #{smart_loaded_path} - #{suggestion} + unrecognized cop or department #{name} found in #{smart_loaded_path} + #{suggestion(name)} MESSAGE unknown_cops << message @@ -117,6 +114,22 @@ raise ValidationError, unknown_cops.join("\n") if unknown_cops.any? end + def suggestion(name) + registry = Cop::Registry.global + departments = registry.departments.map(&:to_s) + suggestions = NameSimilarity.find_similar_names(name, departments + registry.map(&:cop_name)) + if suggestions.any? + "Did you mean `#{suggestions.join('`, `')}`?" + else + # Department names can contain slashes, e.g. Chef/Correctness, but there's no support for + # the concept of higher level departments in RuboCop. It's a flat structure. So if the user + # tries to configure a "top level department", we hint that it's the bottom level + # departments that should be configured. + suggestions = departments.select { |department| department.start_with?("#{name}/") } + "#{name} is not a department. Use `#{suggestions.join('`, `')}`." if suggestions.any? + end + end + def validate_syntax_cop syntax_config = @config['Lint/Syntax'] default_config = ConfigLoader.default_configuration['Lint/Syntax'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rubocop/cop/layout/class_structure.rb new/lib/rubocop/cop/layout/class_structure.rb --- old/lib/rubocop/cop/layout/class_structure.rb 2021-07-06 11:14:54.000000000 +0200 +++ new/lib/rubocop/cop/layout/class_structure.rb 2021-07-23 08:12:25.000000000 +0200 @@ -289,12 +289,16 @@ (node.first_line - 1).downto(1) do |annotation_line| break unless (comment = processed_source.comment_at_line(annotation_line)) - first_comment = comment + first_comment = comment if whole_line_comment_at_line?(annotation_line) end start_line_position(first_comment || node) end + def whole_line_comment_at_line?(line) + /\A\s*#/.match?(processed_source.lines[line - 1]) + end + def start_line_position(node) buffer.line_range(node.loc.line).begin_pos - 1 end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rubocop/cop/layout/end_alignment.rb new/lib/rubocop/cop/layout/end_alignment.rb --- old/lib/rubocop/cop/layout/end_alignment.rb 2021-07-06 11:14:54.000000000 +0200 +++ new/lib/rubocop/cop/layout/end_alignment.rb 2021-07-23 08:12:25.000000000 +0200 @@ -167,7 +167,8 @@ def alignment_node_for_variable_style(node) return node.parent if node.case_type? && node.argument? - assignment = node.ancestors.find(&:assignment_or_similar?) + assignment = assignment_or_operator_method(node) + if assignment && !line_break_before_keyword?(assignment.source_range, node) assignment else @@ -177,6 +178,12 @@ node end end + + def assignment_or_operator_method(node) + node.ancestors.find do |ancestor| + ancestor.assignment_or_similar? || ancestor.send_type? && ancestor.operator_method? + end + end end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rubocop/cop/layout/first_argument_indentation.rb new/lib/rubocop/cop/layout/first_argument_indentation.rb --- old/lib/rubocop/cop/layout/first_argument_indentation.rb 2021-07-06 11:14:54.000000000 +0200 +++ new/lib/rubocop/cop/layout/first_argument_indentation.rb 2021-07-23 08:12:25.000000000 +0200 @@ -154,7 +154,7 @@ def on_send(node) return if style != :consistent && enforce_first_argument_with_fixed_indentation? - return if !node.arguments? || bare_operator?(node) + return if !node.arguments? || bare_operator?(node) || node.setter_method? indent = base_indentation(node) + configured_indentation_width diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rubocop/cop/layout/hash_alignment.rb new/lib/rubocop/cop/layout/hash_alignment.rb --- old/lib/rubocop/cop/layout/hash_alignment.rb 2021-07-06 11:14:54.000000000 +0200 +++ new/lib/rubocop/cop/layout/hash_alignment.rb 2021-07-23 08:12:25.000000000 +0200 @@ -213,7 +213,7 @@ check_pairs(node) end - attr_accessor :offences_by, :column_deltas + attr_accessor :offenses_by, :column_deltas private @@ -224,7 +224,7 @@ end def reset! - self.offences_by = {} + self.offenses_by = {} self.column_deltas = Hash.new { |hash, key| hash[key] = {} } end @@ -248,33 +248,33 @@ end end - add_offences + add_offenses end - def add_offences - kwsplat_offences = offences_by.delete(KeywordSplatAlignment) - register_offences_with_format(kwsplat_offences, KeywordSplatAlignment) + def add_offenses + kwsplat_offenses = offenses_by.delete(KeywordSplatAlignment) + register_offenses_with_format(kwsplat_offenses, KeywordSplatAlignment) - format, offences = offences_by.min_by { |_, v| v.length } - register_offences_with_format(offences, format) + format, offenses = offenses_by.min_by { |_, v| v.length } + register_offenses_with_format(offenses, format) end - def register_offences_with_format(offences, format) - (offences || []).each do |offence| - add_offense(offence, message: MESSAGES[format]) do |corrector| - delta = column_deltas[alignment_for(offence).first.class][offence] + def register_offenses_with_format(offenses, format) + (offenses || []).each do |offense| + add_offense(offense, message: MESSAGES[format]) do |corrector| + delta = column_deltas[alignment_for(offense).first.class][offense] - correct_node(corrector, offence, delta) unless delta.nil? + correct_node(corrector, offense, delta) unless delta.nil? end end end def check_delta(delta, node:, alignment:) - offences_by[alignment.class] ||= [] + offenses_by[alignment.class] ||= [] return if good_alignment? delta column_deltas[alignment.class][node] = delta - offences_by[alignment.class].push(node) + offenses_by[alignment.class].push(node) end def ignore_hash_argument?(node) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rubocop/cop/layout/indentation_style.rb new/lib/rubocop/cop/layout/indentation_style.rb --- old/lib/rubocop/cop/layout/indentation_style.rb 2021-07-06 11:14:54.000000000 +0200 +++ new/lib/rubocop/cop/layout/indentation_style.rb 2021-07-23 08:12:25.000000000 +0200 @@ -43,7 +43,7 @@ str_ranges = string_literal_ranges(processed_source.ast) processed_source.lines.each.with_index(1) do |line, lineno| - next unless (range = find_offence(line, lineno)) + next unless (range = find_offense(line, lineno)) next if in_string_literal?(str_ranges, range) add_offense(range) { |corrector| autocorrect(corrector, range) } @@ -60,7 +60,7 @@ end end - def find_offence(line, lineno) + def find_offense(line, lineno) match = if style == :spaces line.match(/\A\s*\t+/) else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rubocop/cop/lint/duplicate_branch.rb new/lib/rubocop/cop/lint/duplicate_branch.rb --- old/lib/rubocop/cop/lint/duplicate_branch.rb 2021-07-06 11:14:54.000000000 +0200 +++ new/lib/rubocop/cop/lint/duplicate_branch.rb 2021-07-23 08:12:25.000000000 +0200 @@ -4,7 +4,7 @@ module Cop module Lint # This cop checks that there are no repeated bodies - # within `if/unless`, `case-when` and `rescue` constructs. + # within `if/unless`, `case-when`, `case-in` and `rescue` constructs. # # With `IgnoreLiteralBranches: true`, branches are not registered # as offenses if they return a basic literal value (string, symbol, @@ -97,6 +97,7 @@ end alias on_if on_branching_statement alias on_case on_branching_statement + alias on_case_match on_branching_statement alias on_rescue on_branching_statement private diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rubocop/cop/mixin/check_line_breakable.rb new/lib/rubocop/cop/mixin/check_line_breakable.rb --- old/lib/rubocop/cop/mixin/check_line_breakable.rb 2021-07-06 11:14:54.000000000 +0200 +++ new/lib/rubocop/cop/mixin/check_line_breakable.rb 2021-07-23 08:12:25.000000000 +0200 @@ -97,9 +97,9 @@ # If a send node contains a heredoc argument, splitting cannot happen # after the heredoc or else it will cause a syntax error. def shift_elements_for_heredoc_arg(node, elements, index) - return index unless node.send_type? + return index unless node.send_type? || node.array_type? - heredoc_index = elements.index { |arg| (arg.str_type? || arg.dstr_type?) && arg.heredoc? } + heredoc_index = elements.index { |arg| arg.respond_to?(:heredoc?) && arg.heredoc? } return index unless heredoc_index return nil if heredoc_index.zero? diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rubocop/cop/mixin/hash_transform_method.rb new/lib/rubocop/cop/mixin/hash_transform_method.rb --- old/lib/rubocop/cop/mixin/hash_transform_method.rb 2021-07-06 11:14:54.000000000 +0200 +++ new/lib/rubocop/cop/mixin/hash_transform_method.rb 2021-07-23 08:12:25.000000000 +0200 @@ -175,7 +175,12 @@ end def set_new_body_expression(transforming_body_expr, corrector) - corrector.replace(block_node.body, transforming_body_expr.loc.expression.source) + body_source = transforming_body_expr.loc.expression.source + if transforming_body_expr.hash_type? && !transforming_body_expr.braces? + body_source = "{ #{body_source} }" + end + + corrector.replace(block_node.body, body_source) end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rubocop/cop/style/double_cop_disable_directive.rb new/lib/rubocop/cop/style/double_cop_disable_directive.rb --- old/lib/rubocop/cop/style/double_cop_disable_directive.rb 2021-07-06 11:14:54.000000000 +0200 +++ new/lib/rubocop/cop/style/double_cop_disable_directive.rb 2021-07-23 08:12:25.000000000 +0200 @@ -36,13 +36,7 @@ next unless comment.text.scan(/# rubocop:(?:disable|todo)/).size > 1 add_offense(comment) do |corrector| - prefix = if comment.text.start_with?('# rubocop:disable') - '# rubocop:disable' - else - '# rubocop:todo' - end - - corrector.replace(comment, comment.text[/#{prefix} \S+/]) + corrector.replace(comment, comment.text.gsub(%r{ # rubocop:(disable|todo)}, ',')) end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rubocop/cop/style/eval_with_location.rb new/lib/rubocop/cop/style/eval_with_location.rb --- old/lib/rubocop/cop/style/eval_with_location.rb 2021-07-06 11:14:54.000000000 +0200 +++ new/lib/rubocop/cop/style/eval_with_location.rb 2021-07-23 08:12:25.000000000 +0200 @@ -43,7 +43,7 @@ # RUBY # # This cop works only when a string literal is given as a code string. - # No offence is reported if a string variable is given as below: + # No offense is reported if a string variable is given as below: # # @example # # not checked diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rubocop/cop/style/mutable_constant.rb new/lib/rubocop/cop/style/mutable_constant.rb --- old/lib/rubocop/cop/style/mutable_constant.rb 2021-07-06 11:14:54.000000000 +0200 +++ new/lib/rubocop/cop/style/mutable_constant.rb 2021-07-23 08:12:25.000000000 +0200 @@ -61,13 +61,12 @@ def on_casgn(node) _scope, _const_name, value = *node - on_assignment(value) - end + if value.nil? # This is only the case for `CONST += ...` or similarg66 + parent = node.parent + return unless parent.or_asgn_type? # We only care about `CONST ||= ...` - def on_or_asgn(node) - lhs, value = *node - - return unless lhs&.casgn_type? + value = parent.children.last + end on_assignment(value) end @@ -118,14 +117,13 @@ end def mutable_literal?(value) - return false if value.nil? return false if frozen_regexp_or_range_literals?(value) value.mutable_literal? end def immutable_literal?(node) - node.nil? || frozen_regexp_or_range_literals?(node) || node.immutable_literal? + frozen_regexp_or_range_literals?(node) || node.immutable_literal? end def frozen_string_literal?(node) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rubocop/cop/style/single_line_methods.rb new/lib/rubocop/cop/style/single_line_methods.rb --- old/lib/rubocop/cop/style/single_line_methods.rb 2021-07-06 11:14:54.000000000 +0200 +++ new/lib/rubocop/cop/style/single_line_methods.rb 2021-07-23 08:12:25.000000000 +0200 @@ -72,17 +72,15 @@ end def correct_to_multiline(corrector, node) - each_part(node.body) do |part| - LineBreakCorrector.break_line_before( - range: part, node: node, corrector: corrector, - configured_width: configured_indentation_width - ) + if (body = node.body) && body.begin_type? && body.parenthesized_call? + break_line_before(corrector, node, body) + else + each_part(body) do |part| + break_line_before(corrector, node, part) + end end - LineBreakCorrector.break_line_before( - range: node.loc.end, node: node, corrector: corrector, - indent_steps: 0, configured_width: configured_indentation_width - ) + break_line_before(corrector, node, node.loc.end, indent_steps: 0) move_comment(node, corrector) end @@ -96,6 +94,13 @@ corrector.replace(node, replacement) end + def break_line_before(corrector, node, range, indent_steps: 1) + LineBreakCorrector.break_line_before( + range: range, node: node, corrector: corrector, + configured_width: configured_indentation_width, indent_steps: indent_steps + ) + end + def each_part(body) return unless body diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rubocop/formatter/git_hub_actions_formatter.rb new/lib/rubocop/formatter/git_hub_actions_formatter.rb --- old/lib/rubocop/formatter/git_hub_actions_formatter.rb 2021-07-06 11:14:54.000000000 +0200 +++ new/lib/rubocop/formatter/git_hub_actions_formatter.rb 2021-07-23 08:12:25.000000000 +0200 @@ -33,7 +33,7 @@ output.printf( "\n::%<severity>s file=%<file>s,line=%<line>d,col=%<column>d::%<message>s\n", severity: github_severity(offense), - file: file, + file: PathUtil.smart_path(file), line: offense.line, column: offense.real_column, message: github_escape(offense.message) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rubocop/version.rb new/lib/rubocop/version.rb --- old/lib/rubocop/version.rb 2021-07-06 11:14:54.000000000 +0200 +++ new/lib/rubocop/version.rb 2021-07-23 08:12:25.000000000 +0200 @@ -3,7 +3,7 @@ module RuboCop # This module holds the RuboCop version information. module Version - STRING = '1.18.3' + STRING = '1.18.4' MSG = '%<version>s (using Parser %<parser_version>s, '\ 'rubocop-ast %<rubocop_ast_version>s, ' \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2021-07-06 11:14:54.000000000 +0200 +++ new/metadata 2021-07-23 08:12:25.000000000 +0200 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: rubocop version: !ruby/object:Gem::Version - version: 1.18.3 + version: 1.18.4 platform: ruby authors: - Bozhidar Batsov @@ -10,7 +10,7 @@ autorequire: bindir: exe cert_chain: [] -date: 2021-07-06 00:00:00.000000000 Z +date: 2021-07-23 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: parallel @@ -100,7 +100,7 @@ requirements: - - ">=" - !ruby/object:Gem::Version - version: 1.7.0 + version: 1.8.0 - - "<" - !ruby/object:Gem::Version version: '2.0' @@ -110,7 +110,7 @@ requirements: - - ">=" - !ruby/object:Gem::Version - version: 1.7.0 + version: 1.8.0 - - "<" - !ruby/object:Gem::Version version: '2.0'