Fix all RuboCop violations for rubocop 1.89 compatibility - #658
Open
tungleduyxyz wants to merge 7 commits into
Open
Fix all RuboCop violations for rubocop 1.89 compatibility#658tungleduyxyz wants to merge 7 commits into
tungleduyxyz wants to merge 7 commits into
Conversation
Replace disable/enable pairs with disable-next-line directives and fix double-space after `when` keywords in custom_fields_controller. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
rubocop 1.89 introduced Lint/CopDirectiveSyntax which rejects disable-next-line directives. Replace all disable-next-line comments with inline rubocop:disable on the specific offense lines. Also fix genuine violations: - queues_controller: refactor begin/rescue/ensure pattern to eliminate Lint/SuppressedException and Lint/EnsureReturn - engine_controller_util: simplify get_layout, remove useless layout ||= assignment - invoices_controller, bundles_controller: inline-suppress Lint/HashCompareByIdentity on actual offense lines (not method def) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The Lint/HashCompareByIdentity cop flagged hsh[entry.object_id] patterns. Rather than suppressing, use group_by(&:object_id) which is cleaner and idiomatic. Note: object_id here is a Kill Bill API attribute (UUID string), not Ruby's Object#object_id. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Reader methods should not be prefixed with get_. Rename to current_layout to avoid conflict with Rails' layout class macro. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace float equality (unreliable for money) with to_d comparison so partial vs full refund detection works correctly for all amounts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use .dup to create distinct objects with the same email value instead of comparing an object to itself. Tests the same invariant (equal email values compare as 0) without identical operands. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Prevent future CI breakage from unexpected rubocop upgrades introducing new cops. Use ~> patch-level pins so bugfixes still apply automatically. Upgrade intentionally by bumping these constraints when ready. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or 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
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.
Summary
Lint/CopDirectiveSyntaxwhich rejectsdisable-next-lineas an invalid mode (onlyenable,disable,todo,push,popare valid). Replaced alldisable-next-linecomments with inline# rubocop:disableon the specific offense lines.queues_controller.rbby refactoring thebegin/rescue/ensurepattern to eliminateLint/SuppressedExceptionandLint/EnsureReturn.get_layoutinengine_controller_util.rbby removing the uselesslayout ||=assignment.HashCompareByIdentityinline suppression to the actual offense lines (previously the comment was on thedefline, not the real violations).Rubocop result: 172 files inspected, no offenses detected
Test plan
🤖 Generated with Claude Code