-
Notifications
You must be signed in to change notification settings - Fork 89
Update rubocop to 1.71, rubocop-rspec to 3.4 #325
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
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
This is more idiomatic, per the RSpec/ImplicitSubject rule.
This is unnecessary in ruby, single quotes are sufficient for multi-line strings. See https://dev.to/jbranchaud/there-is-no-triple-quote-multi-line-string-syntax-in-ruby-4gj5
… test This has been pending for a long time, and resolving this seems out of scope for what pg_query does when it runs its fingerprinting. We don't gain much by keeping this, and it clutters the test output.
Its not clear what the open item here is, and this is most likely a accidental leftover from when this code was modified in e4eff25.
All Struct objects have "length" defined (which is the number of fields in the Struct), and it seems sensible to not override this unnecessarily.
This is in anticipation of a follow-up commit that updates the Rubocop version to the latest and introduces new stylistic checks that seem acceptable to enable.
This is considered more idiomatic, and gets flagged by newer Rubocop versions.
This also lets us drop the Ruby 3.0 requirement for rubocop on CI, since we can now use rubocop on all released Ruby versions. Further, turn off some of the newly introduced cops that seem to add unnecessary noise, and opt in to new cops by default (this avoids a warning, and seems fine since we lock the rubocop version). Also, drop inline disabling of the "Lint/EmptyWhen" lint, which is no longer needed.
seanlinsley
reviewed
Apr 2, 2025
@@ -7,7 +7,7 @@ def param_refs # rubocop:disable Metrics/CyclomaticComplexity | |||
case node | |||
when PgQuery::ParamRef | |||
# Ignore param refs inside type casts, as these are already handled | |||
next if location[-3..-1] == %i[type_cast arg param_ref] | |||
next if location[-3..] == %i[type_cast arg param_ref] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirming that this is equivalent:
>> [0,1,2,3,4,5][-3..]
=> [3, 4, 5]
>> [0,1,2,3,4,5][-3..-1]
=> [3, 4, 5]
seanlinsley
approved these changes
Apr 2, 2025
msakrejda
approved these changes
Apr 2, 2025
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.
Plus do (some of) the stylistic fixes that newer Rubocop releases ask for, see individual commits.