Skip to content
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

Fix rubocop 1.65 compatability #16

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

Darhazer
Copy link
Contributor

@Darhazer Darhazer commented Jul 10, 2024

ignored_method? was an alias for alias for allowed_method? for ages. Rubocop 1.65 [broke than method(by essentially making the signature incompatible).
This just allows running the cop with no errors. It still produces deprecation warnings around the auto-correct deprecation
Also updated the auto-corrector to use the new API.
Note: I don't see any reason for the caching of the corrector, as nodes are simply passed to the constructor, but traversed during the actual correction. Since RuboCop executed the check again after each correction though (which changed the AST), we should not use a cached version of the siblings.

@Darhazer Darhazer force-pushed the rubobop-1-65-compatability branch from 487c263 to 7c9bd43 Compare July 10, 2024 15:55
@@ -466,7 +466,7 @@ def self.a; end
'Layout/OrderedMethods',
file.path
])
expect($stderr.string).to eq('')
Copy link
Contributor Author

@Darhazer Darhazer Jul 10, 2024

Choose a reason for hiding this comment

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

It produces

warning: support_autocorrect? is deprecated. Use cop.class.support_autocorrect?.

which is harder to fix

@Darhazer Darhazer force-pushed the rubobop-1-65-compatability branch from aa24918 to f82b938 Compare July 16, 2024 13:05
@Darhazer Darhazer force-pushed the rubobop-1-65-compatability branch from f82b938 to 0d6d9b5 Compare July 16, 2024 13:07
@shanecav84
Copy link
Owner

Thanks for the update and the removing the cache - I wasn't sure exactly how traversing and correcting interacted.

@shanecav84 shanecav84 merged commit 0c68204 into shanecav84:master Jul 16, 2024
8 checks passed
@shanecav84
Copy link
Owner

Released in 0.12.

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.

2 participants