-
Notifications
You must be signed in to change notification settings - Fork 11
chore: update ruby version, audit some cops #88
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
viacheslav-rostovtsev
merged 3 commits into
googleapis:main
from
viacheslav-rostovtsev:dev/virost/chore/update_ruby_31
Apr 28, 2025
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,10 @@ | |
| AllCops: | ||
| NewCops: disable | ||
| SuggestExtensions: false | ||
| TargetRubyVersion: 3.0 | ||
| TargetRubyVersion: 3.1 | ||
|
|
||
| Gemspec/AddRuntimeDependency: # new in 1.65 | ||
| Enabled: true | ||
|
|
||
| # Added in Rubocop 1.30 | ||
| Gemspec/DeprecatedAttributeAssignment: | ||
|
|
@@ -62,6 +65,9 @@ Layout/LineLength: | |
| Layout/SpaceBeforeBrackets: | ||
| Enabled: true | ||
|
|
||
| Lint/ArrayLiteralInRegexp: # new in 1.71 | ||
| Enabled: true | ||
|
|
||
| # Added in Rubocop 1.7 | ||
| Lint/AmbiguousAssignment: | ||
| Enabled: true | ||
|
|
@@ -78,6 +84,12 @@ Lint/AmbiguousRange: | |
| Lint/ConstantOverwrittenInRescue: | ||
| Enabled: true | ||
|
|
||
| Lint/ConstantReassignment: # new in 1.70 | ||
| Enabled: true | ||
|
|
||
| Lint/CopDirectiveSyntax: # new in 1.72 | ||
| Enabled: true | ||
|
|
||
| # Samples often use Kernel#p which Lint/Debugger doesn't like. | ||
| Lint/Debugger: | ||
| Exclude: | ||
|
|
@@ -104,6 +116,9 @@ Lint/DuplicateMatchPattern: | |
| Lint/DuplicateRegexpCharacterClassElement: | ||
| Enabled: true | ||
|
|
||
| Lint/DuplicateSetElement: # new in 1.67 | ||
| Enabled: true | ||
|
|
||
| # Added in Rubocop 1.1 | ||
| Lint/EmptyBlock: | ||
| Enabled: true | ||
|
|
@@ -116,6 +131,9 @@ Lint/EmptyClass: | |
| Lint/EmptyInPattern: | ||
| Enabled: true | ||
|
|
||
| Lint/HashNewWithKeywordArgumentsAsDefault: # new in 1.69 | ||
| Enabled: true | ||
|
|
||
| # Added in Rubocop 1.21 | ||
| Lint/IncompatibleIoSelectWithFiberScheduler: | ||
| Enabled: true | ||
|
|
@@ -148,6 +166,10 @@ Lint/NonAtomicFileOperation: | |
| Lint/NumberedParameterAssignment: | ||
| Enabled: true | ||
|
|
||
| # Can easily appear in the generated code | ||
| Lint/NumericOperationWithConstantResult: # new in 1.69 | ||
| Enabled: false | ||
|
|
||
| # Added in Rubocop 1.9 | ||
| Lint/OrAssignmentToConstant: | ||
| Enabled: true | ||
|
|
@@ -160,6 +182,10 @@ Lint/RedundantDirGlobSort: | |
| Lint/RedundantRegexpQuantifiers: | ||
| Enabled: true | ||
|
|
||
| # Can easily appear in the generated code | ||
| Lint/RedundantTypeConversion: # new in 1.72 | ||
| Enabled: false | ||
|
|
||
| # Added in Rubocop 1.27 | ||
| Lint/RefinementImportMethods: | ||
| Enabled: true | ||
|
|
@@ -176,6 +202,12 @@ Lint/RequireRelativeSelfPath: | |
| Lint/SafeNavigationConsistency: | ||
| Enabled: false | ||
|
|
||
| Lint/SharedMutableDefault: # new in 1.70 | ||
| Enabled: true | ||
|
|
||
| Lint/SuppressedExceptionInNumberConversion: # new in 1.72 | ||
| Enabled: true | ||
|
|
||
| # Added in Rubocop 1.9 | ||
| Lint/SymbolConversion: | ||
| Enabled: true | ||
|
|
@@ -192,10 +224,23 @@ Lint/TripleQuotes: | |
| Lint/UnexpectedBlockArity: | ||
| Enabled: true | ||
|
|
||
| Lint/UnescapedBracketInRegexp: # new in 1.68 | ||
| Enabled: true | ||
|
|
||
| # Added in Rubocop 1.1 | ||
| Lint/UnmodifiedReduceAccumulator: | ||
| Enabled: true | ||
|
|
||
| Lint/UselessConstantScoping: # new in 1.72 | ||
| Enabled: true | ||
|
|
||
| Lint/UselessDefined: # new in 1.69 | ||
| Enabled: true | ||
|
|
||
| # Can easily appear in the generated code | ||
| Lint/UselessNumericOperation: # new in 1.66 | ||
| Enabled: false | ||
|
|
||
| # Added in Rubocop 1.43 | ||
| Lint/UselessRescue: | ||
| Enabled: true | ||
|
|
@@ -251,6 +296,9 @@ Security/IoMethods: | |
| Style/AccessorGrouping: | ||
| EnforcedStyle: separated | ||
|
|
||
| Style/AmbiguousEndlessMethodDefinition: # new in 1.68 | ||
| Enabled: true | ||
|
|
||
| # Added in Rubocop 1.1 | ||
| Style/ArgumentsForwarding: | ||
| Enabled: true | ||
|
|
@@ -259,6 +307,9 @@ Style/ArgumentsForwarding: | |
| RedundantRestArgumentNames: [] # To support Ruby < 3.2 | ||
| UseAnonymousForwarding: false # To support Ruby < 3.2 | ||
|
|
||
| Style/ArrayIntersect: # new in 1.40 | ||
| Enabled: true | ||
|
|
||
| # Problematic for generated code which might include unicode in comments. | ||
| Style/AsciiComments: | ||
| Enabled: false | ||
|
|
@@ -272,6 +323,9 @@ Style/CaseEquality: | |
| Style/CollectionCompact: | ||
| Enabled: true | ||
|
|
||
| Style/CombinableDefined: # new in 1.68 | ||
| Enabled: true | ||
|
|
||
| # Added in Rubocop 1.44 | ||
| Style/ComparableClamp: | ||
| Enabled: true | ||
|
|
@@ -280,6 +334,9 @@ Style/ComparableClamp: | |
| Style/ConcatArrayLiterals: | ||
| Enabled: true | ||
|
|
||
| Style/DigChain: # new in 1.69 | ||
| Enabled: true | ||
|
|
||
| # Added in Rubocop 1.48 | ||
| Style/DirEmpty: | ||
| Enabled: true | ||
|
|
@@ -336,6 +393,9 @@ Style/HashConversion: | |
| Style/HashExcept: | ||
| Enabled: true | ||
|
|
||
| Style/HashFetchChain: # new in 1.75 | ||
| Enabled: true | ||
|
|
||
| # It is sometimes preferable to use the non-modifier form even for single-line | ||
| # expressions, for readability. | ||
| Style/IfUnlessModifier: | ||
|
|
@@ -349,6 +409,12 @@ Style/IfWithBooleanLiteralBranches: | |
| Style/InPatternThen: | ||
| Enabled: true | ||
|
|
||
| Style/ItAssignment: # new in 1.70 | ||
| Enabled: true | ||
|
|
||
| Style/ItBlockParameter: # new in 1.75 | ||
| Enabled: true | ||
|
|
||
| # Added in Rubocop 1.35 | ||
| Style/MagicCommentFormat: | ||
| Enabled: true | ||
|
|
@@ -516,6 +582,10 @@ Style/RescueModifier: | |
| Style/ReturnNilInPredicateMethodDefinition: | ||
| Enabled: true | ||
|
|
||
| # Disabled since length of navigation chain is not a problem. | ||
| Style/SafeNavigationChainLength: # new in 1.68 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you provide a short note explaining why we want to disable this one?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added |
||
| Enabled: false | ||
|
|
||
| # We disagree with this one. Grep is more specialized than select/reject. | ||
| Style/SelectByRegexp: | ||
| Enabled: false | ||
|
|
||
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.
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.
We do run a pass of
rubocop -ain the generator. Is this insufficient to remove cases of this and some of the others below?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.
I don't see the benefit of doing this as I barely agree that having
+= 0in the codebase is problematic.