-
Notifications
You must be signed in to change notification settings - Fork 1
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
Bump rubocop from 1.56.0 to 1.56.1 #518
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.56.0 to 1.56.1. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](rubocop/rubocop@v1.56.0...v1.56.1) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
|
gem compare --diff rubocop 1.56.0 1.56.1 Compared versions: ["1.56.0", "1.56.1"]
DIFFERENT files:
1.56.0->1.56.1:
* Changed:
lib/rubocop/cop/bundler/duplicated_group.rb
--- /tmp/d20230822-2513-pi35di/rubocop-1.56.0/lib/rubocop/cop/bundler/duplicated_group.rb 2023-08-22 02:05:22.340522780 +0000
+++ /tmp/d20230822-2513-pi35di/rubocop-1.56.1/lib/rubocop/cop/bundler/duplicated_group.rb 2023-08-22 02:05:22.536526359 +0000
@@ -7,0 +8,18 @@
+ # For example, if the values of `source`, `git`, `platforms`, or `path`
+ # surrounding `group` are different, no offense will be registered:
+ #
+ # [source,ruby]
+ # -----
+ # platforms :ruby do
+ # group :default do
+ # gem 'openssl'
+ # end
+ # end
+ #
+ # platforms :jruby do
+ # group :default do
+ # gem 'jruby-openssl'
+ # end
+ # end
+ # -----
+ #
@@ -44,0 +63,4 @@
+ SOURCE_BLOCK_NAMES = %i[source git platforms path].freeze
+
+ # @!method group_declarations(node)
+ def_node_search :group_declarations, '(send nil? :group ...)'
@@ -51 +73,3 @@
- register_offense(node, node.arguments.map(&:value).join(', '), nodes.first.first_line)
+ group_name = node.arguments.map(&:source).join(', ')
+
+ register_offense(node, group_name, nodes.first.first_line)
@@ -58,3 +81,0 @@
- # @!method group_declarations(node)
- def_node_search :group_declarations, '(send nil? :group ...)'
-
@@ -62,4 +83,9 @@
- group_declarations(processed_source.ast)
- .group_by { |node| node.arguments.map(&:value).map(&:to_s).sort }
- .values
- .select { |nodes| nodes.size > 1 }
+ group_declarations = group_declarations(processed_source.ast)
+ group_keys = group_declarations.group_by do |node|
+ source_key = find_source_key(node)
+ group_attributes = group_attributes(node).sort.join
+
+ "#{source_key}#{group_attributes}"
+ end
+
+ group_keys.values.select { |nodes| nodes.size > 1 }
@@ -76,0 +103,20 @@
+ end
+
+ def find_source_key(node)
+ source_block = node.each_ancestor(:block).find do |block_node|
+ SOURCE_BLOCK_NAMES.include?(block_node.method_name)
+ end
+
+ return unless source_block
+
+ "#{source_block.method_name}#{source_block.send_node.first_argument&.source}"
+ end
+
+ def group_attributes(node)
+ node.arguments.map do |argument|
+ if argument.hash_type?
+ argument.pairs.map(&:source).sort.join(', ')
+ else
+ argument.value.to_s
+ end
+ end
lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb
--- /tmp/d20230822-2513-pi35di/rubocop-1.56.0/lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb 2023-08-22 02:05:22.344522853 +0000
+++ /tmp/d20230822-2513-pi35di/rubocop-1.56.1/lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb 2023-08-22 02:05:22.540526432 +0000
@@ -17,3 +17,7 @@
- # Avoid correcting to `lambdado` by inserting whitespace
- # if none exists before or after the lambda arguments.
- insert_separating_space(corrector)
+ if block_node.block_type?
+ # Avoid correcting to `lambdado` by inserting whitespace
+ # if none exists before or after the lambda arguments.
+ insert_separating_space(corrector)
+
+ remove_arguments(corrector)
+ end
@@ -22 +25,0 @@
- remove_arguments(corrector)
lib/rubocop/cop/layout/leading_comment_space.rb
--- /tmp/d20230822-2513-pi35di/rubocop-1.56.0/lib/rubocop/cop/layout/leading_comment_space.rb 2023-08-22 02:05:22.356523073 +0000
+++ /tmp/d20230822-2513-pi35di/rubocop-1.56.1/lib/rubocop/cop/layout/leading_comment_space.rb 2023-08-22 02:05:22.552526651 +0000
@@ -60 +60 @@
- next unless /\A#+[^#\s=+-]/.match?(comment.text)
+ next unless /\A(?!#\+\+|#--)(#+[^#\s=])/.match?(comment.text)
lib/rubocop/cop/layout/line_continuation_spacing.rb
--- /tmp/d20230822-2513-pi35di/rubocop-1.56.0/lib/rubocop/cop/layout/line_continuation_spacing.rb 2023-08-22 02:05:22.356523073 +0000
+++ /tmp/d20230822-2513-pi35di/rubocop-1.56.1/lib/rubocop/cop/layout/line_continuation_spacing.rb 2023-08-22 02:05:22.552526651 +0000
@@ -112 +112 @@
- comments.map(&:loc).map(&:expression)
+ comments.map(&:source_range)
lib/rubocop/cop/layout/redundant_line_break.rb
--- /tmp/d20230822-2513-pi35di/rubocop-1.56.0/lib/rubocop/cop/layout/redundant_line_break.rb 2023-08-22 02:05:22.356523073 +0000
+++ /tmp/d20230822-2513-pi35di/rubocop-1.56.1/lib/rubocop/cop/layout/redundant_line_break.rb 2023-08-22 02:05:22.552526651 +0000
@@ -121 +121,3 @@
- processed_source.comments.map(&:loc).map(&:line).any? do |comment_line_number|
+ comment_line_numbers = processed_source.comments.map { |comment| comment.loc.line }
+
+ comment_line_numbers.any? do |comment_line_number|
lib/rubocop/cop/lint/non_atomic_file_operation.rb
--- /tmp/d20230822-2513-pi35di/rubocop-1.56.0/lib/rubocop/cop/lint/non_atomic_file_operation.rb 2023-08-22 02:05:22.368523292 +0000
+++ /tmp/d20230822-2513-pi35di/rubocop-1.56.1/lib/rubocop/cop/lint/non_atomic_file_operation.rb 2023-08-22 02:05:22.564526870 +0000
@@ -60 +60 @@
- def_node_search :send_exist_node, <<-PATTERN
+ def_node_search :send_exist_node, <<~PATTERN
@@ -65 +65 @@
- def_node_matcher :receiver_and_method_name, <<-PATTERN
+ def_node_matcher :receiver_and_method_name, <<~PATTERN
lib/rubocop/cop/lint/useless_assignment.rb
--- /tmp/d20230822-2513-pi35di/rubocop-1.56.0/lib/rubocop/cop/lint/useless_assignment.rb 2023-08-22 02:05:22.376523438 +0000
+++ /tmp/d20230822-2513-pi35di/rubocop-1.56.1/lib/rubocop/cop/lint/useless_assignment.rb 2023-08-22 02:05:22.572527017 +0000
@@ -99,2 +99 @@
- " Use `#{assignment.operator.sub(/=$/, '')}` " \
- "instead of `#{assignment.operator}`."
+ " Use `#{assignment.operator.delete_suffix('=')}` instead of `#{assignment.operator}`."
lib/rubocop/cop/naming/file_name.rb
--- /tmp/d20230822-2513-pi35di/rubocop-1.56.0/lib/rubocop/cop/naming/file_name.rb 2023-08-22 02:05:22.388523657 +0000
+++ /tmp/d20230822-2513-pi35di/rubocop-1.56.1/lib/rubocop/cop/naming/file_name.rb 2023-08-22 02:05:22.696529281 +0000
@@ -139 +139 @@
- basename = basename.sub(/^\./, '')
+ basename = basename.delete_prefix('.')
lib/rubocop/cop/style/arguments_forwarding.rb
--- /tmp/d20230822-2513-pi35di/rubocop-1.56.0/lib/rubocop/cop/style/arguments_forwarding.rb 2023-08-22 02:05:22.392523730 +0000
+++ /tmp/d20230822-2513-pi35di/rubocop-1.56.1/lib/rubocop/cop/style/arguments_forwarding.rb 2023-08-22 02:05:22.700529354 +0000
@@ -82,0 +83 @@
+ ADDITIONAL_ARG_TYPES = %i[lvar arg].freeze
@@ -215 +216 @@
- arguments = node.arguments
+ arguments = node.arguments.reject { |arg| ADDITIONAL_ARG_TYPES.include?(arg.type) }
@@ -282 +283 @@
- elsif target_ruby_version >= 3.2
+ else
@@ -335,2 +336 @@
- splat_index = arguments.index(forwarded_rest_arg)
- arg_after_splat = arguments[splat_index + 1]
+ return true unless (splat_index = arguments.index(forwarded_rest_arg))
@@ -337,0 +338 @@
+ arg_after_splat = arguments[splat_index + 1]
lib/rubocop/cop/style/concat_array_literals.rb
--- /tmp/d20230822-2513-pi35di/rubocop-1.56.0/lib/rubocop/cop/style/concat_array_literals.rb 2023-08-22 02:05:22.396523803 +0000
+++ /tmp/d20230822-2513-pi35di/rubocop-1.56.1/lib/rubocop/cop/style/concat_array_literals.rb 2023-08-22 02:05:22.704529427 +0000
@@ -77 +77 @@
- arg.children.map(&:value).map(&:inspect)
+ arg.children.map { |child| child.value.inspect }
lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb
--- /tmp/d20230822-2513-pi35di/rubocop-1.56.0/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb 2023-08-22 02:05:22.500525702 +0000
+++ /tmp/d20230822-2513-pi35di/rubocop-1.56.1/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb 2023-08-22 02:05:22.716529646 +0000
@@ -149 +149,3 @@
- node.parent&.match_pattern_type?
+ return false unless (parent = node.parent)
+
+ parent.match_pattern_type? || parent.match_pattern_p_type?
lib/rubocop/cop/style/open_struct_use.rb
--- /tmp/d20230822-2513-pi35di/rubocop-1.56.0/lib/rubocop/cop/style/open_struct_use.rb 2023-08-22 02:05:22.504525775 +0000
+++ /tmp/d20230822-2513-pi35di/rubocop-1.56.1/lib/rubocop/cop/style/open_struct_use.rb 2023-08-22 02:05:22.720529719 +0000
@@ -48 +48 @@
- def_node_matcher :uses_open_struct?, <<-PATTERN
+ def_node_matcher :uses_open_struct?, <<~PATTERN
lib/rubocop/cop/style/redundant_parentheses.rb
--- /tmp/d20230822-2513-pi35di/rubocop-1.56.0/lib/rubocop/cop/style/redundant_parentheses.rb 2023-08-22 02:05:22.508525848 +0000
+++ /tmp/d20230822-2513-pi35di/rubocop-1.56.1/lib/rubocop/cop/style/redundant_parentheses.rb 2023-08-22 02:05:22.728529865 +0000
@@ -101 +101,3 @@
- node.send_type? && node.arguments.one? && !node.parenthesized? &&
+ return false if !node.send_type? && !node.super_type? && !node.yield_type?
+
+ node.arguments.one? && !node.parenthesized? &&
lib/rubocop/cop/style/redundant_self_assignment_branch.rb
--- /tmp/d20230822-2513-pi35di/rubocop-1.56.0/lib/rubocop/cop/style/redundant_self_assignment_branch.rb 2023-08-22 02:05:22.508525848 +0000
+++ /tmp/d20230822-2513-pi35di/rubocop-1.56.1/lib/rubocop/cop/style/redundant_self_assignment_branch.rb 2023-08-22 02:05:22.728529865 +0000
@@ -77,0 +78,5 @@
+ if opposite_branch.respond_to?(:heredoc?) && opposite_branch.heredoc?
+ replacement += opposite_branch.loc.heredoc_end.with(
+ begin_pos: opposite_branch.source_range.end_pos
+ ).source
+ end
lib/rubocop/cop/style/symbol_array.rb
--- /tmp/d20230822-2513-pi35di/rubocop-1.56.0/lib/rubocop/cop/style/symbol_array.rb 2023-08-22 02:05:22.512525921 +0000
+++ /tmp/d20230822-2513-pi35di/rubocop-1.56.1/lib/rubocop/cop/style/symbol_array.rb 2023-08-22 02:05:22.732529938 +0000
@@ -71,0 +72,2 @@
+ return false if DELIMITERS.include?(sym.source)
+
lib/rubocop/cop/utils/regexp_ranges.rb
--- /tmp/d20230822-2513-pi35di/rubocop-1.56.0/lib/rubocop/cop/utils/regexp_ranges.rb 2023-08-22 02:05:22.516525994 +0000
+++ /tmp/d20230822-2513-pi35di/rubocop-1.56.1/lib/rubocop/cop/utils/regexp_ranges.rb 2023-08-22 02:05:22.736530011 +0000
@@ -9 +9 @@
- attr_reader :compound_token, :root
+ attr_reader :root
@@ -13,0 +14,8 @@
+ @pairs = []
+ @populated = false
+ end
+
+ def compound_token
+ populate_all unless @populated
+
+ @compound_token
@@ -17,4 +25,9 @@
- unless @pairs
- @pairs = []
- populate(root)
- end
+ populate_all unless @populated
+
+ @pairs
+ end
+
+ private
+
+ def populate_all
+ populate(@root)
@@ -26,2 +39 @@
- @pairs.map { |pair| pair.map(&:first) }
- end
+ @pairs.map! { |pair| pair.map(&:first) }
@@ -29 +41,2 @@
- private
+ @populated = true
+ end
@@ -38,2 +51,2 @@
- compound_token << current
- compound_token.concat(pop_octal_digits(expressions))
+ @compound_token << current
+ @compound_token.concat(pop_octal_digits(expressions))
@@ -46 +59 @@
- compound_token.clear
+ @compound_token.clear
@@ -67,2 +80,2 @@
- range_start = if compound_token.size.between?(1, 2) && octal_digit?(range_start.text)
- compound_token.dup << range_start
+ range_start = if @compound_token.size.between?(1, 2) && octal_digit?(range_start.text)
+ @compound_token.dup << range_start
lib/rubocop/target_ruby.rb
--- /tmp/d20230822-2513-pi35di/rubocop-1.56.0/lib/rubocop/target_ruby.rb 2023-08-22 02:05:22.528526213 +0000
+++ /tmp/d20230822-2513-pi35di/rubocop-1.56.1/lib/rubocop/target_ruby.rb 2023-08-22 02:05:22.748530230 +0000
@@ -158,3 +158,5 @@
- # @!method gem_requirement?(node)
- def_node_matcher :gem_requirement?, <<~PATTERN
- (send (const(const _ :Gem):Requirement) :new $str)
+ # @!method gem_requirement_versions(node)
+ def_node_matcher :gem_requirement_versions, <<~PATTERN
+ (send (const(const _ :Gem):Requirement) :new
+ {$str+ | (send $str :freeze)+ | (array $str+) | (array (send $str :freeze)+)}
+ )
@@ -196,0 +199,2 @@
+ gem_requirement_versions = gem_requirement_versions(right_hand_side)
+
@@ -199,2 +203,2 @@
- elsif gem_requirement?(right_hand_side)
- right_hand_side.children.last.value
+ elsif gem_requirement_versions
+ gem_requirement_versions.map(&:value)
lib/rubocop/version.rb
--- /tmp/d20230822-2513-pi35di/rubocop-1.56.0/lib/rubocop/version.rb 2023-08-22 02:05:22.528526213 +0000
+++ /tmp/d20230822-2513-pi35di/rubocop-1.56.1/lib/rubocop/version.rb 2023-08-22 02:05:22.748530230 +0000
@@ -6 +6 @@
- STRING = '1.56.0'
+ STRING = '1.56.1'
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bumps rubocop from 1.56.0 to 1.56.1.
Release notes
Sourced from rubocop's releases.
Changelog
Sourced from rubocop's changelog.
Commits
24e7411
Cut 1.56.1a3c111b
Update Changelog53433c4
Fix a false negative forLayout/LeadingCommentSpace
ce93abd
[Fix #12134] Fix a false positive forStyle/MethodCallWithArgsParentheses
6815290
Merge pull request #12133 from r7kamura/style-redundant-self-assignment-branc...75580b3
FixStyle/RedundantSelfAssignmentBranch
to handle heredocsdd29994
Use squiggly heredoc23dc4de
Merge pull request #12127 from ItsEcholot/bugfix/required_ruby_version_gem_re...252af0d
[Fix #12105] Adjust target ruby gem requirement matcher and version parsing t...2cb9dea
Merge pull request #12121 from chulkilee/fix-warningDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditions
will show all of the ignore conditions of the specified dependency@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)