Upgrade Rubocop 1.88.2#1001
Conversation
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Code Review
This pull request primarily updates numerous Ruby gem dependencies in Gemfile.lock, including a major upgrade to Rails 8.1.3 and RuboCop 1.88.2, along with many RuboCop extensions. Concurrently, it introduces documentation for several new RuboCop cops and updates existing cop descriptions across various docs/description/*.md files, including grammatical corrections, improved explanations, and updated examples. The docs/description/description.json and docs/patterns.json files have also been updated to reflect these changes. The review comments highlight several issues with the generated documentation, such as incorrect parsing of RuboCop directives, incorrect source URLs for extension cops, and formatting errors like missing newlines in code examples.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| @@ -1,4 +1,4 @@ | |||
|
|
|||
|
|
|||
| rubocop:disable Metrics/ClassLength | |||
| page.find(:css, '#first').assert_matches_style(display: 'block') | ||
| ``` | ||
|
|
||
| [Source](http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Capybara/AssertStyle) No newline at end of file |
There was a problem hiding this comment.
The source URL points to the rubocop gem instead of rubocop-capybara. There is a general issue in the documentation generator where extension cops (from rubocop-capybara, rubocop-rspec, rubocop-rails, etc.) are incorrectly linked under the rubocop gem namespace on rubydoc.info.
| [Source](http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Capybara/AssertStyle) | |
| [Source](http://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/AssertStyle) |
| # good | ||
| foo do |bar| | ||
| # ... | ||
| end# bad |
| # ... | ||
| end | ||
| end# good | ||
| end# bad |
| # ... | ||
| end | ||
| end# good | ||
| end# bad |
| hash[key] | ||
|
|
||
| # good | ||
| hash.fetch(key)# good |
| @@ -47,6 +47,9 @@ end | |||
|
|
|||
| # good (but potentially an unsafe correction) | |||
| foo.do_something?# good | |||
| @@ -55,6 +55,9 @@ end | |||
|
|
|||
| # good | |||
| a.nil? || a# good | |||
|
|
||
| # good | ||
| object[1, 2, | ||
| 3, 4]# bad |
| a, b, _something = foo() | ||
| a, *b, _ = foo | ||
| # => The correction `a, *b, = foo` is a syntax error# good | ||
| a, b, _something = foo# bad |
There was a problem hiding this comment.
Pull Request Overview
Although the PR successfully updates RuboCop metadata to version 1.88.2 and satisfies Codacy standards, the generated documentation is currently not in a mergeable state. A systemic tool failure has caused labels (like '# bad') to be concatenated directly onto code lines across dozens of files, making them unreadable and invalid for copy-pasting. Furthermore, several files contain logical contradictions—marking identical code blocks as both 'good' and 'bad'—and one documentation file (I18n_GetText_DecorateFunctionMessage.md) is corrupted. A specific logic error in the Style/ArrayIntersect documentation must also be corrected, as the suggested refactor would invert program logic.
About this PR
- The PR description is missing, which is problematic for a change touching over 100 files. Furthermore, a widespread formatting failure exists where documentation markers are merged with code; this should be addressed at the source of the generation script rather than through manual file-by-file fixes.
Test suggestions
- Verify that all new patternIds in description.json have a matching .md file in docs/description/
- Validate the syntax and structure of docs/patterns.json and docs/description/description.json against their expected schemas
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify that all new patternIds in description.json have a matching .md file in docs/description/
2. Validate the syntax and structure of docs/patterns.json and docs/description/description.json against their expected schemas
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
| # bad | ||
| array1.any? { |elem| array2.member?(elem) } | ||
| array1.none? { |elem| array2.member?(elem) } | ||
| array1.none? { |elem| array2.include?(elem) } |
There was a problem hiding this comment.
🔴 HIGH RISK
The 'none?' example is not logically equivalent to the suggested 'intersect?' call. Inverting the logic would occur if 'array1.none? { |elem| array2.include?(elem) }' is replaced with 'array1.intersect?(array2)'. The correct equivalent is '!array1.intersect?(array2)'.
| @@ -1,4 +1,4 @@ | |||
|
|
|||
|
|
|||
| rubocop:disable Metrics/ClassLength | |||
There was a problem hiding this comment.
🔴 HIGH RISK
This documentation file appears to be corrupted or incorrectly generated. It contains a RuboCop disable directive instead of the expected cop description and code examples, making it unhelpful for users.
| CONST = [{ a: [], b: 'foo' }].freeze# bad - nested mutable literals must be frozen too | ||
| CONST = [{ a: [], b: 'foo' }].freeze | ||
|
|
||
| # good | ||
| CONST = [{ a: [].freeze, b: 'foo'.freeze }.freeze].freeze# bad |
There was a problem hiding this comment.
🟡 MEDIUM RISK
The documentation examples here are corrupted and mislabeled. Line 55 marks a 'good' example as '# bad', and line 51 is a duplicate of line 52 with a corrupted comment. This requires manual cleanup to ensure the guidance is valid.
|
|
||
| memoize :attribute_b | ||
| # bad | ||
| class ErrorA < BaseError; end |
There was a problem hiding this comment.
🟡 MEDIUM RISK
This example labels two consecutive single-line classes as 'bad', but identical code is labeled 'good' at line 66. This contradiction needs to be resolved to provide clear guidance.
| b, | ||
| c | ||
| # good | ||
| a = b, |
There was a problem hiding this comment.
🟡 MEDIUM RISK
This example classifies 'a = b, \n c' as 'good', which directly contradicts the classification of the exact same code block as 'bad' at line 21 within the same file.
| # good | ||
| foo do |bar| | ||
| # ... | ||
| end# bad |
There was a problem hiding this comment.
🟡 MEDIUM RISK
The documentation label '# bad' is incorrectly concatenated to the preceding code line (e.g., 'end# bad'). This systemic formatting error occurs across nearly all updated markdown files in this PR (including Naming_PredicateMethod.md and Style_CaseEquality.md), likely due to a broken automated generation script. Labels must be moved to their own line to ensure readability and valid code examples.
No description provided.