Skip to content

Commit

Permalink
Upgrade to modern Rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
benlangfeld committed Jan 2, 2024
1 parent 67c479d commit c822c3e
Show file tree
Hide file tree
Showing 6 changed files with 250 additions and 63 deletions.
31 changes: 15 additions & 16 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
---
require:
- rubocop-performance
- rubocop-rake

inherit_from:
- .rubocop_todo.yml

AllCops:
TargetRubyVersion: 2.4
NewCops: enable

Layout/LineLength:
Max: 120
Exclude:
- 'departure.gemspec'
- 'test_database.rb'

Metrics/AbcSize:
Enabled: false
Expand All @@ -20,12 +31,6 @@ Metrics/BlockNesting:
Metrics/ClassLength:
Max: 250

Metrics/LineLength:
Max: 120
Exclude:
- 'departure.gemspec'
- 'test_database.rb'

Metrics/MethodLength:
Max: 30

Expand All @@ -38,12 +43,6 @@ Metrics/ParameterLists:
Performance/Casecmp:
Enabled: false

Style/BracesAroundHashParameters:
Exclude:
- 'spec/fixtures/migrate/**.rb'
- 'spec/integration/**.rb'
- 'spec/lhm/adapter/**.rb'

Style/CommandLiteral:
Exclude:
- 'test_database.rb'
Expand All @@ -61,9 +60,9 @@ Style/MultilineBlockChain:
Layout/MultilineMethodCallIndentation:
Enabled: false

Style/SymbolArray:
Enabled: false

Style/UnneededPercentQ:
Style/RedundantPercentQ:
Exclude:
- 'departure.gemspec'

Style/SymbolArray:
Enabled: false
268 changes: 227 additions & 41 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,84 +1,276 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-01-02 13:03:20 -0300 using RuboCop version 0.49.1.
# on 2024-01-02 18:14:50 UTC using RuboCop version 1.59.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: 5
# Configuration parameters: EnforcedStyle, AllowedGems, Include.
# SupportedStyles: Gemfile, gems.rb, gemspec
# Include: **/*.gemspec, **/Gemfile, **/gems.rb
Gemspec/DevelopmentDependencies:
Exclude:
- 'departure.gemspec'

# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
# Include: **/*.gemspec
Gemspec/OrderedDependencies:
Exclude:
- 'departure.gemspec'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Severity, Include.
# Include: **/*.gemspec
Gemspec/RequireMFA:
Exclude:
- 'departure.gemspec'

# Offense count: 1
# Configuration parameters: Severity, Include.
# Include: **/*.gemspec
Gemspec/RequiredRubyVersion:
Exclude:
- 'departure.gemspec'

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: leading, trailing
Layout/DotPosition:
Exclude:
- 'spec/integration/indexes_spec.rb'

# Offense count: 6
# This cop supports safe autocorrection (--autocorrect).
Layout/EmptyLineAfterGuardClause:
Exclude:
- 'lib/active_record/connection_adapters/for_alter.rb'
- 'lib/active_record/connection_adapters/percona_adapter.rb'
- 'lib/departure/alter_argument.rb'
- 'lib/departure/log_sanitizers/password_sanitizer.rb'
- 'lib/departure/migration.rb'

# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: SupportedStyles, IndentationWidth.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: IndentationWidth.
# SupportedStyles: special_inside_parentheses, consistent, align_brackets
Layout/IndentArray:
Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: Width, IgnoredPatterns.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Width, AllowedPatterns.
Layout/IndentationWidth:
Exclude:
- 'spec/integration/indexes_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment.
Layout/LeadingCommentSpace:
Exclude:
- 'lib/active_record/connection_adapters/for_alter.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SupportedStylesForEmptyBraces.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
# SupportedStyles: space, no_space, compact
# SupportedStylesForEmptyBraces: space, no_space
Layout/SpaceInsideHashLiteralBraces:
Exclude:
- 'spec/active_record/connection_adapters/percona_adapter_spec.rb'

# Offense count: 9
# Configuration parameters: AllowedMethods.
# AllowedMethods: enums
Lint/ConstantDefinitionInBlock:
Exclude:
- 'spec/integration/change_table_spec.rb'
- 'spec/integration/columns_spec.rb'
- 'spec/integration/data_migrations_spec.rb'
- 'spec/integration/foreign_keys_spec.rb'
- 'spec/integration/indexes_spec.rb'
- 'spec/integration/references_spec.rb'
- 'spec/integration/tables_spec.rb'
- 'spec/integration_spec.rb'
- 'spec/lhm_integration_spec.rb'

# Offense count: 4
# Configuration parameters: AllowComments, AllowEmptyLambdas.
Lint/EmptyBlock:
Exclude:
- 'spec/departure/runner_spec.rb'
- 'spec/fixtures/migrate/0005_no_statements.rb'
- 'spec/spec_helper.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Lint/IncompatibleIoSelectWithFiberScheduler:
Exclude:
- 'lib/departure/command.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
Lint/RedundantCopDisableDirective:
Exclude:
- 'lib/active_record/connection_adapters/percona_adapter.rb'
- 'lib/departure/command.rb'

# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
Lint/SendWithMixinArgument:
Exclude:
- 'spec/spec_helper.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
Lint/UnusedMethodArgument:
Exclude:
- 'lib/active_record/connection_adapters/for_alter.rb'
- 'spec/spec_helper.rb'

# Offense count: 1
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 123
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
Naming/MethodParameterName:
Exclude:
- 'lib/active_record/connection_adapters/percona_adapter.rb'

# Offense count: 1
# Cop supports --auto-correct.
# This cop supports unsafe autocorrection (--autocorrect-all).
Security/YAMLLoad:
Exclude:
- 'configuration.rb'

# Offense count: 12
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: braces, no_braces, context_dependent
Style/BracesAroundHashParameters:
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle, AllowModifiersOnSymbols.
# SupportedStyles: inline, group
Style/AccessModifierDeclarations:
Exclude:
- 'spec/fixtures/migrate/**.rb'
- 'spec/integration/**.rb'
- 'spec/lhm/adapter/add_unique_index_spec.rb'
- 'spec/lhm/adapter/remove_index_spec.rb'
- 'lib/departure/migration.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: compact, expanded
Style/EmptyMethod:
Exclude:
- 'spec/fixtures/migrate/0029_disable_departure.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Style/Encoding:
Exclude:
- 'departure.gemspec'

# Offense count: 4
# This cop supports safe autocorrection (--autocorrect).
Style/ExpandPathArguments:
Exclude:
- 'departure.gemspec'
- 'spec/lhm_integration_spec.rb'
- 'spec/spec_helper.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowedVars.
Style/FetchEnvVar:
Exclude:
- 'lib/departure/user_options.rb'

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/GlobalStdStream:
Exclude:
- 'lib/active_record/connection_adapters/for_alter.rb'
- 'spec/spec_helper.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
Style/IfUnlessModifier:
Exclude:
- 'lib/active_record/connection_adapters/percona_adapter.rb'
- 'lib/departure/connection_details.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedMethods.
# AllowedMethods: nonzero?
Style/IfWithBooleanLiteralBranches:
Exclude:
- 'lib/lhm/column_with_sql.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: literals, strict
Style/MutableConstant:
Exclude:
- 'lib/departure/alter_argument.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Style/NegatedIfElseCondition:
Exclude:
- 'lib/lhm/column_with_sql.rb'

# Offense count: 2
# Configuration parameters: AllowedMethods.
# AllowedMethods: respond_to_missing?
Style/OptionalBooleanParameter:
Exclude:
- 'lib/departure/logger.rb'
- 'lib/departure/null_logger.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Methods.
Style/RedundantArgument:
Exclude:
- 'lib/departure/alter_argument.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantConditional:
Exclude:
- 'lib/lhm/column_with_sql.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/RedundantInterpolation:
Exclude:
- 'spec/active_record/connection_adapters/percona_adapter_spec.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantRegexpArgument:
Exclude:
- 'lib/departure/alter_argument.rb'
- 'spec/integration/indexes_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Style/StderrPuts:
Exclude:
- 'lib/active_record/connection_adapters/for_alter.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Mode.
Style/StringConcatenation:
Exclude:
- 'lib/departure/dsn.rb'

# Offense count: 12
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Exclude:
Expand All @@ -89,23 +281,17 @@ Style/StringLiterals:
- 'spec/lhm/column_with_sql_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline, SupportedStylesForMultiline.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInArguments:
Exclude:
- 'spec/departure/runner_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline, SupportedStylesForMultiline.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInLiteral:
Style/TrailingCommaInArrayLiteral:
Exclude:
- 'spec/integration/data_migrations_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/UnneededInterpolation:
Exclude:
- 'spec/active_record/connection_adapters/percona_adapter_spec.rb'
Loading

0 comments on commit c822c3e

Please sign in to comment.