Skip to content

Upgrade Rubocop 1.88.2#1001

Open
DMarinhoCodacy wants to merge 1 commit into
masterfrom
Upgrade-Rubocop-1.88.2
Open

Upgrade Rubocop 1.88.2#1001
DMarinhoCodacy wants to merge 1 commit into
masterfrom
Upgrade-Rubocop-1.88.2

Conversation

@DMarinhoCodacy

Copy link
Copy Markdown
Contributor

No description provided.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The description for this cop has been incorrectly parsed as rubocop:disable Metrics/ClassLength. This appears to be a bug in the documentation parser/generator extracting inline RuboCop directives from the source code instead of the actual cop description.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
[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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The # bad header is concatenated directly with the preceding end keyword due to a missing newline in the documentation generator.

Suggested change
end# bad
end
# bad

# ...
end
end# good
end# bad

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The # bad header is concatenated directly with the preceding end keyword due to a missing newline in the documentation generator.

Suggested change
end# bad
end
# bad

# ...
end
end# good
end# bad

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The # bad header is concatenated directly with the preceding end keyword due to a missing newline in the documentation generator.

Suggested change
end# bad
end
# bad

hash[key]

# good
hash.fetch(key)# good

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The # good header is concatenated directly with the preceding closing parenthesis due to a missing newline in the documentation generator.

Suggested change
hash.fetch(key)# good
hash.fetch(key)
# good

@@ -47,6 +47,9 @@ end

# good (but potentially an unsafe correction)
foo.do_something?# good

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The # good header is concatenated directly with the preceding expression due to a missing newline in the documentation generator.

Suggested change
foo.do_something?# good
foo.do_something?
# good

@@ -55,6 +55,9 @@ end

# good
a.nil? || a# good

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The # good header is concatenated directly with the preceding expression due to a missing newline in the documentation generator.

Suggested change
a.nil? || a# good
a.nil? || a
# good


# good
object[1, 2,
3, 4]# bad

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The # bad header is concatenated directly with the preceding closing bracket due to a missing newline in the documentation generator.

Suggested change
3, 4]# bad
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The # bad header is concatenated directly with the preceding expression due to a missing newline in the documentation generator.

Suggested change
a, b, _something = foo# bad
a, b, _something = foo
# bad

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 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.

Comment on lines +51 to +55
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant