Hello community, here is the log from the commit of package rubygem-rubocop for openSUSE:Factory checked in at 2020-03-03 10:19:00 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-rubocop (Old) and /work/SRC/openSUSE:Factory/.rubygem-rubocop.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-rubocop" Tue Mar 3 10:19:00 2020 rev:9 rq:781048 version:0.80.1 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-rubocop/rubygem-rubocop.changes 2020-02-19 12:41:16.535709547 +0100 +++ /work/SRC/openSUSE:Factory/.rubygem-rubocop.new.26092/rubygem-rubocop.changes 2020-03-03 10:20:38.523196793 +0100 @@ -1,0 +2,27 @@ +Mon Mar 2 19:53:50 UTC 2020 - Dan Čermák <dcer...@suse.com> + +- New upstream release 0.80.1 + + ## 0.80.1 (2020-02-29) + + ### Bug fixes + + * [#7719](https://github.com/rubocop-hq/rubocop/issues/7719): Fix + `Style/NestedParenthesizedCalls` cop for newline. ([@tejasbubane][]) + * [#7709](https://github.com/rubocop-hq/rubocop/issues/7709): Fix correction + of `Style/RedundantCondition` when the else branch contains a + range. ([@rrosenblum][]) + * [#7682](https://github.com/rubocop-hq/rubocop/issues/7682): Fix + `Style/InverseMethods` autofix leaving parenthesis. ([@tejasbubane][]) + * [#7745](https://github.com/rubocop-hq/rubocop/issues/7745): Suppress a + pending cop warnings when pending cop's department is disabled. ([@koic][]) + * [#7759](https://github.com/rubocop-hq/rubocop/issues/7759): Fix an error for + `Layout/LineLength` cop when using lambda syntax that argument is not + enclosed in parentheses. ([@koic][]) + + ### Changes + + * [#7765](https://github.com/rubocop-hq/rubocop/pull/7765): When warning about + a pending cop, display the version with the cop added. ([@koic][]) + +------------------------------------------------------------------- Old: ---- rubocop-0.80.0.gem New: ---- rubocop-0.80.1.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-rubocop.spec ++++++ --- /var/tmp/diff_new_pack.InjGkZ/_old 2020-03-03 10:20:40.155200170 +0100 +++ /var/tmp/diff_new_pack.InjGkZ/_new 2020-03-03 10:20:40.159200178 +0100 @@ -25,7 +25,7 @@ # of those fields # Name: rubygem-rubocop -Version: 0.80.0 +Version: 0.80.1 Release: 0 Summary: Automatic Ruby code style checking tool License: MIT ++++++ rubocop-0.80.0.gem -> rubocop-0.80.1.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 2020-02-18 12:39:07.000000000 +0100 +++ new/README.md 2020-02-29 19:05:05.000000000 +0100 @@ -53,7 +53,7 @@ might want to use a conservative version lock in your `Gemfile`: ```rb -gem 'rubocop', '~> 0.80.0', require: false +gem 'rubocop', '~> 0.80.1', require: false ``` ## Quickstart Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/config/default.yml new/config/default.yml --- old/config/default.yml 2020-02-18 12:39:07.000000000 +0100 +++ new/config/default.yml 2020-02-29 19:05:05.000000000 +0100 @@ -2820,11 +2820,13 @@ Style/HashTransformKeys: Description: 'Prefer `transform_keys` over `each_with_object` and `map`.' Enabled: 'pending' + VersionAdded: '0.80' Safe: false Style/HashTransformValues: Description: 'Prefer `transform_values` over `each_with_object` and `map`.' Enabled: 'pending' + VersionAdded: '0.80' Safe: false Style/IdenticalConditionalBranches: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rubocop/config.rb new/lib/rubocop/config.rb --- old/lib/rubocop/config.rb 2020-02-18 12:39:07.000000000 +0100 +++ new/lib/rubocop/config.rb 2020-02-29 19:05:05.000000000 +0100 @@ -2,6 +2,9 @@ require 'pathname' +# FIXME: Moving Rails department code to RuboCop Rails will remove +# the following rubocop:disable comment. +# rubocop:disable Metrics/ClassLength module RuboCop # This class represents the configuration of the RuboCop application # and all its cops. A Config is associated with a YAML configuration @@ -13,6 +16,8 @@ include FileFinder extend Forwardable + CopConfig = Struct.new(:name, :metadata) + DEFAULT_RAILS_VERSION = 5.0 attr_reader :loaded_path @@ -215,6 +220,18 @@ nil end + def pending_cops + keys.each_with_object([]) do |qualified_cop_name, pending_cops| + department = department_of(qualified_cop_name) + next if department && department['Enabled'] == false + + cop_metadata = self[qualified_cop_name] + next unless cop_metadata['Enabled'] == 'pending' + + pending_cops << CopConfig.new(qualified_cop_name, cop_metadata) + end + end + private def target_rails_version_from_bundler_lock_file @@ -235,17 +252,18 @@ end def enable_cop?(qualified_cop_name, cop_options) - cop_department, cop_name = qualified_cop_name.split('/') - department = cop_name.nil? - - unless department - department_options = self[cop_department] - if department_options && department_options['Enabled'] == false - return false - end - end + department = department_of(qualified_cop_name) + return false if department && department['Enabled'] == false cop_options.fetch('Enabled') { !for_all_cops['DisabledByDefault'] } end + + def department_of(qualified_cop_name) + cop_department, cop_name = qualified_cop_name.split('/') + return nil if cop_name.nil? + + self[cop_department] + end end end +# rubocop:enable Metrics/ClassLength diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rubocop/config_loader.rb new/lib/rubocop/config_loader.rb --- old/lib/rubocop/config_loader.rb 2020-02-18 12:39:07.000000000 +0100 +++ new/lib/rubocop/config_loader.rb 2020-02-29 19:05:05.000000000 +0100 @@ -92,7 +92,7 @@ add_excludes_from_files(config, config_file) end merge_with_default(config, config_file).tap do |merged_config| - warn_on_pending_cops(merged_config) + warn_on_pending_cops(merged_config.pending_cops) end end @@ -116,20 +116,20 @@ end end - def warn_on_pending_cops(config) - pending_cops = config.keys.select do |key| - config[key]['Enabled'] == 'pending' - end - - return if pending_cops.none? + def warn_on_pending_cops(pending_cops) + return if pending_cops.empty? warn Rainbow('The following cops were added to RuboCop, but are not ' \ 'configured. Please set Enabled to either `true` or ' \ '`false` in your `.rubocop.yml` file:').yellow pending_cops.each do |cop| - warn Rainbow(" - #{cop}").yellow + warn Rainbow( + " - #{cop.name} (#{cop.metadata['VersionAdded']})" + ).yellow end + + warn Rainbow('For more information: https://docs.rubocop.org/en/latest/versioning/').yellow end # Merges the given configuration with the default one. If diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rubocop/cop/layout/line_length.rb new/lib/rubocop/cop/layout/line_length.rb --- old/lib/rubocop/cop/layout/line_length.rb 2020-02-18 12:39:07.000000000 +0100 +++ new/lib/rubocop/cop/layout/line_length.rb 2020-02-29 19:05:05.000000000 +0100 @@ -131,7 +131,7 @@ end def breakable_block_range(block_node) - if block_node.arguments? + if block_node.arguments? && !block_node.lambda? block_node.arguments.loc.end else block_node.loc.begin 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 2020-02-18 12:39:07.000000000 +0100 +++ new/lib/rubocop/cop/mixin/hash_transform_method.rb 2020-02-29 19:05:05.000000000 +0100 @@ -51,7 +51,6 @@ end def handle_possible_offense(node, match, match_desc) - puts node.class captures = extract_captures(match) # If key didn't actually change either, this is most likely a false diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rubocop/cop/style/inverse_methods.rb new/lib/rubocop/cop/style/inverse_methods.rb --- old/lib/rubocop/cop/style/inverse_methods.rb 2020-02-18 12:39:07.000000000 +0100 +++ new/lib/rubocop/cop/style/inverse_methods.rb 2020-02-29 19:05:05.000000000 +0100 @@ -109,10 +109,7 @@ corrector.remove(not_to_receiver(node, method_call)) corrector.replace(method_call.loc.selector, inverse_methods[method].to_s) - - if EQUALITY_METHODS.include?(method) - corrector.remove(end_parentheses(node, method_call)) - end + remove_end_parenthesis(corrector, node, method, method_call) end end @@ -187,6 +184,13 @@ def dot_range(loc) range_between(loc.dot.begin_pos, loc.expression.end_pos) end + + def remove_end_parenthesis(corrector, node, method, method_call) + return unless EQUALITY_METHODS.include?(method) || + method_call.parent.begin_type? + + corrector.remove(end_parentheses(node, method_call)) + end end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rubocop/cop/style/nested_parenthesized_calls.rb new/lib/rubocop/cop/style/nested_parenthesized_calls.rb --- old/lib/rubocop/cop/style/nested_parenthesized_calls.rb 2020-02-18 12:39:07.000000000 +0100 +++ new/lib/rubocop/cop/style/nested_parenthesized_calls.rb 2020-02-29 19:05:05.000000000 +0100 @@ -35,8 +35,8 @@ last_arg = nested.last_argument.source_range leading_space = - range_with_surrounding_space(range: first_arg, - side: :left).begin.resize(1) + range_with_surrounding_space(range: first_arg.begin, + side: :left) lambda do |corrector| corrector.replace(leading_space, '(') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rubocop/cop/style/redundant_condition.rb new/lib/rubocop/cop/style/redundant_condition.rb --- old/lib/rubocop/cop/style/redundant_condition.rb 2020-02-18 12:39:07.000000000 +0100 +++ new/lib/rubocop/cop/style/redundant_condition.rb 2020-02-29 19:05:05.000000000 +0100 @@ -46,7 +46,7 @@ def autocorrect(node) lambda do |corrector| if node.ternary? - corrector.replace(range_of_offense(node), '||') + correct_ternary(corrector, node) elsif node.modifier_form? || !node.else_branch corrector.replace(node.source_range, node.if_branch.source) else @@ -90,9 +90,13 @@ end def else_source(else_branch) - wrap_else = - else_branch.basic_conditional? && else_branch.modifier_form? - wrap_else ? "(#{else_branch.source})" : else_branch.source + if else_branch.basic_conditional? && + else_branch.modifier_form? || + else_branch.range_type? + "(#{else_branch.source})" + else + else_branch.source + end end def make_ternary_form(node) @@ -106,6 +110,15 @@ ternary_form end end + + def correct_ternary(corrector, node) + corrector.replace(range_of_offense(node), '||') + + return unless node.else_branch.range_type? + + corrector.insert_before(node.else_branch.loc.expression, '(') + corrector.insert_after(node.else_branch.loc.expression, ')') + end end end end 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 2020-02-18 12:39:07.000000000 +0100 +++ new/lib/rubocop/version.rb 2020-02-29 19:05:05.000000000 +0100 @@ -3,7 +3,7 @@ module RuboCop # This module holds the RuboCop version information. module Version - STRING = '0.80.0' + STRING = '0.80.1' MSG = '%<version>s (using Parser %<parser_version>s, running on ' \ '%<ruby_engine>s %<ruby_version>s %<ruby_platform>s)' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2020-02-18 12:39:07.000000000 +0100 +++ new/metadata 2020-02-29 19:05:05.000000000 +0100 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: rubocop version: !ruby/object:Gem::Version - version: 0.80.0 + version: 0.80.1 platform: ruby authors: - Bozhidar Batsov @@ -10,7 +10,7 @@ autorequire: bindir: exe cert_chain: [] -date: 2020-02-18 00:00:00.000000000 Z +date: 2020-02-29 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: jaro_winkler @@ -797,7 +797,7 @@ - !ruby/object:Gem::Version version: '0' requirements: [] -rubygems_version: 3.0.3 +rubygems_version: 3.1.2 signing_key: specification_version: 4 summary: Automatic Ruby code style checking tool.