-
Notifications
You must be signed in to change notification settings - Fork 549
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
Upgrade RuboCop to v1.30 #1268
Merged
+155
−70
Merged
Upgrade RuboCop to v1.30 #1268
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
989cc25
Upgrade RuboCop to the latest
mishina2228 d238d7f
Install RuboCop only on Ruby 2.6+
mishina2228 a9517ac
Fix some simple cops
mishina2228 75665fa
Regenerate .rubocop_todo.yml to let rubocop pass
mishina2228 0d9622d
Opt out NewCops and RuboCop extensions
mishina2228 ad9d23b
Remove the extra `psych` for older versions of RuboCop
mishina2228 aee1fcb
Upgrade RuboCop to >= 1.30.1
mishina2228 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 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 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 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 |
---|---|---|
@@ -1,95 +1,176 @@ | ||
# This configuration was generated by | ||
# `rubocop --auto-gen-config` | ||
# on 2017-11-25 19:54:28 -0500 using RuboCop version 0.50.0. | ||
# on 2022-05-30 13:48:55 UTC using RuboCop version 1.30.0. | ||
# The point is for the user to remove these configuration records | ||
# one by one as the offenses are removed from the code base. | ||
# Note that changes in the inspected code, or installation of new | ||
# versions of RuboCop, may require this file to be generated again. | ||
|
||
# Offense count: 3 | ||
# Cop supports --auto-correct. | ||
# Configuration parameters: EnforcedStyle, SupportedStyles. | ||
# SupportedStyles: auto_detection, squiggly, active_support, powerpack, unindent | ||
Layout/IndentHeredoc: | ||
# This cop supports safe autocorrection (--autocorrect). | ||
Layout/HeredocIndentation: | ||
Exclude: | ||
- 'support/ruby_enc_to_mysql.rb' | ||
- 'tasks/compile.rake' | ||
|
||
# Offense count: 2 | ||
# Configuration parameters: AllowedMethods. | ||
# AllowedMethods: enums | ||
Lint/ConstantDefinitionInBlock: | ||
Exclude: | ||
- 'spec/mysql2/client_spec.rb' | ||
- 'tasks/rspec.rake' | ||
|
||
# Offense count: 1 | ||
Lint/MissingSuper: | ||
Exclude: | ||
- 'lib/mysql2/em.rb' | ||
|
||
# Offense count: 2 | ||
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes. | ||
Metrics/AbcSize: | ||
Max: 91 | ||
Max: 94 | ||
|
||
# Offense count: 31 | ||
# Configuration parameters: CountComments, ExcludedMethods. | ||
# Offense count: 34 | ||
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods. | ||
# IgnoredMethods: refine | ||
Metrics/BlockLength: | ||
Max: 860 | ||
Max: 592 | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: CountBlocks. | ||
Metrics/BlockNesting: | ||
Max: 5 | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: CountComments. | ||
# Configuration parameters: CountComments, CountAsOne. | ||
Metrics/ClassLength: | ||
Max: 135 | ||
|
||
# Offense count: 3 | ||
# Configuration parameters: IgnoredMethods. | ||
Metrics/CyclomaticComplexity: | ||
Max: 32 | ||
|
||
# Offense count: 313 | ||
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. | ||
# URISchemes: http, https | ||
Metrics/LineLength: | ||
Max: 232 | ||
Max: 34 | ||
|
||
# Offense count: 6 | ||
# Configuration parameters: CountComments. | ||
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods. | ||
Metrics/MethodLength: | ||
Max: 57 | ||
|
||
# Offense count: 2 | ||
# Configuration parameters: IgnoredMethods. | ||
Metrics/PerceivedComplexity: | ||
Max: 29 | ||
Max: 32 | ||
|
||
# Offense count: 3 | ||
# Configuration parameters: Blacklist. | ||
# Blacklist: END, (?-mix:EO[A-Z]{1}) | ||
# Offense count: 2 | ||
# Configuration parameters: ForbiddenDelimiters. | ||
# ForbiddenDelimiters: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$)) | ||
Naming/HeredocDelimiterNaming: | ||
Exclude: | ||
- 'tasks/compile.rake' | ||
|
||
# Offense count: 10 | ||
# Offense count: 1 | ||
# This cop supports unsafe autocorrection (--autocorrect-all). | ||
Style/CaseLikeIf: | ||
Exclude: | ||
- 'ext/mysql2/extconf.rb' | ||
|
||
# Offense count: 8 | ||
# Configuration parameters: AllowedConstants. | ||
Style/Documentation: | ||
Exclude: | ||
- 'spec/**/*' | ||
- 'test/**/*' | ||
- 'benchmark/active_record.rb' | ||
- 'benchmark/allocations.rb' | ||
- 'benchmark/query_with_mysql_casting.rb' | ||
- 'lib/mysql2.rb' | ||
- 'lib/mysql2/client.rb' | ||
- 'lib/mysql2/em.rb' | ||
- 'lib/mysql2/error.rb' | ||
- 'lib/mysql2/result.rb' | ||
- 'lib/mysql2/statement.rb' | ||
|
||
# Offense count: 14 | ||
# Offense count: 6 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
Style/ExpandPathArguments: | ||
Exclude: | ||
- 'ext/mysql2/extconf.rb' | ||
- 'mysql2.gemspec' | ||
- 'spec/mysql2/client_spec.rb' | ||
- 'support/mysql_enc_to_ruby.rb' | ||
- 'tasks/compile.rake' | ||
|
||
# Offense count: 15 | ||
# Configuration parameters: AllowedVariables. | ||
Style/GlobalVars: | ||
Exclude: | ||
- 'ext/mysql2/extconf.rb' | ||
|
||
# Offense count: 17 | ||
# Cop supports --auto-correct. | ||
# Configuration parameters: Strict. | ||
# Offense count: 8 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
Style/IfUnlessModifier: | ||
Exclude: | ||
- 'lib/mysql2.rb' | ||
- 'lib/mysql2/client.rb' | ||
- 'spec/mysql2/client_spec.rb' | ||
|
||
# Offense count: 1 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: AllowMethodComparison. | ||
Style/MultipleComparison: | ||
Exclude: | ||
- 'lib/mysql2/client.rb' | ||
|
||
# Offense count: 18 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: Strict, AllowedNumbers. | ||
Style/NumericLiterals: | ||
MinDigits: 20 | ||
|
||
# Offense count: 726 | ||
# Cop supports --auto-correct. | ||
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline. | ||
# Offense count: 4 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength. | ||
# AllowedMethods: present?, blank?, presence, try, try! | ||
Style/SafeNavigation: | ||
Exclude: | ||
- 'benchmark/setup_db.rb' | ||
- 'ext/mysql2/extconf.rb' | ||
- 'lib/mysql2/em.rb' | ||
|
||
# Offense count: 14 | ||
# This cop supports unsafe autocorrection (--autocorrect-all). | ||
# Configuration parameters: Mode. | ||
Style/StringConcatenation: | ||
Exclude: | ||
- 'benchmark/active_record.rb' | ||
- 'benchmark/active_record_threaded.rb' | ||
- 'benchmark/allocations.rb' | ||
- 'benchmark/escape.rb' | ||
- 'benchmark/query_with_mysql_casting.rb' | ||
- 'benchmark/query_without_mysql_casting.rb' | ||
- 'benchmark/sequel.rb' | ||
- 'benchmark/setup_db.rb' | ||
- 'ext/mysql2/extconf.rb' | ||
- 'lib/mysql2/client.rb' | ||
- 'tasks/compile.rake' | ||
|
||
# Offense count: 782 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. | ||
# SupportedStyles: single_quotes, double_quotes | ||
Style/StringLiterals: | ||
Enabled: false | ||
|
||
# Offense count: 1 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: WordRegex. | ||
# SupportedStyles: percent, brackets | ||
Style/WordArray: | ||
EnforcedStyle: percent | ||
MinSize: 4 | ||
|
||
# Offense count: 32 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns. | ||
# URISchemes: http, https | ||
Layout/LineLength: | ||
Max: 232 |
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 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 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 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 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 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 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
Oops, something went wrong.
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.
I think the next release could drop Ruby < 2.2
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 tried to omit if-else condition, but rake 13.x supports only Ruby 2.2+.
So can we drop Ruby 2.1 from the CI matrix?
mysql2/.github/workflows/build.yml
Lines 18 to 27 in 80e0001
and also CentOS 7 with Ruby 2.0.0?
mysql2/.github/workflows/container.yml
Lines 14 to 15 in 80e0001