Skip to content

Commit

Permalink
Update Rubocop settings
Browse files Browse the repository at this point in the history
Rubocop has renamed or removed a number of cops.  This PR updates our
settings to use the new names and removes references to the no longer
supported cops.

This is also required to get the Rubocop RubyMine integration working.
  • Loading branch information
jonahx committed Jun 22, 2020
1 parent 3685b6e commit b44e7a1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 64 deletions.
12 changes: 5 additions & 7 deletions .rubocop_settings.yml
Expand Up @@ -12,8 +12,8 @@ Style/RescueStandardError:
EnforcedStyle: implicit
Style/AndOr:
EnforcedStyle: conditionals
Layout/IndentHeredoc:
EnforcedStyle: squiggly
Layout/HeredocIndentation:
Enabled: true
Layout/MultilineMethodCallBraceLayout:
EnforcedStyle: symmetrical
Layout/SpaceAroundBlockParameters:
Expand All @@ -35,7 +35,7 @@ Layout/SpaceInsideParens:
Layout/SpaceInsideReferenceBrackets:
EnforcedStyle: no_space
EnforcedStyleForEmptyBrackets: no_space
Layout/TrailingBlankLines:
Layout/TrailingEmptyLines:
EnforcedStyle: final_newline
Style/BarePercentLiterals:
EnforcedStyle: percent_q
Expand All @@ -55,17 +55,15 @@ Layout/SpaceInsideArrayLiteralBrackets:
EnforcedStyleForEmptyBrackets: no_space

# The default configuration of these makes it hard to use proportional fonts.
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/AlignParameters:
Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation
Layout/EndAlignment:
EnforcedStyleAlignWith: start_of_line
Layout/ExtraSpacing:
AllowForAlignment: false
Layout/FirstParameterIndentation:
EnforcedStyle: consistent
Layout/IndentHash:
Layout/FirstHashElementIndentation:
EnforcedStyle: consistent
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Expand Down
70 changes: 13 additions & 57 deletions .rubocop_todo.yml
Expand Up @@ -12,15 +12,15 @@
# SupportedHashRocketStyles: key, separator, table
# SupportedColonStyles: key, separator, table
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
Layout/AlignHash:
Layout/HashAlignment:
Exclude:
- 'config/routes.rb'

# Offense count: 16
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: with_first_parameter, with_fixed_indentation
Layout/AlignParameters:
Layout/ParameterAlignment:
Exclude:
- 'app/controllers/secrets_controller.rb'
- 'app/domain/authentication/authn_ldap/authenticator.rb'
Expand Down Expand Up @@ -140,22 +140,22 @@ Layout/FirstParameterIndentation:
# Cop supports --auto-correct.
# 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: EnforcedStyle, IndentationWidth.
# SupportedStyles: special_inside_parentheses, consistent, align_braces
Layout/IndentHash:
Layout/FirstHashElementIndentation:
Exclude:
- 'spec/app/domain/authentication/authn_iam/authenticator_spec.rb'

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: auto_detection, squiggly, active_support, powerpack, unindent
Layout/IndentHeredoc:
Layout/HeredocIndentation:
Exclude:
- 'bin/conjur-cli.rb'

Expand Down Expand Up @@ -331,7 +331,7 @@ Layout/SpaceInsideReferenceBrackets:
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: final_newline, final_blank_line
Layout/TrailingBlankLines:
Layout/TrailingEmptyLines:
Exclude:
- '.pryrc'
- 'app/controllers/concerns/assumed_role.rb'
Expand Down Expand Up @@ -402,7 +402,7 @@ Lint/DuplicateMethods:
- 'app/models/schemata.rb'

# Offense count: 3
Lint/HandleExceptions:
Lint/SuppressedException:
Exclude:
- 'app/domain/authentication/authn_k8s/authenticator.rb'
- 'app/models/role.rb'
Expand Down Expand Up @@ -458,15 +458,15 @@ Lint/ShadowingOuterLocalVariable:

# Offense count: 3
# Cop supports --auto-correct.
Lint/StringConversionInInterpolation:
Lint/RedundantStringCoercion:
Exclude:
- 'app/domain/authentication/authn_iam/authenticator.rb'
- 'app/models/authn_local.rb'
- 'lib/tasks/account.rake'

# Offense count: 1
# Cop supports --auto-correct.
Lint/UnneededSplatExpansion:
Lint/RedundantSplatExpansion:
Exclude:
- 'lib/tasks/policy.rake'

Expand Down Expand Up @@ -606,7 +606,7 @@ Naming/PredicateName:
# Offense count: 22
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: io, id, to, by, on, in, at, ip
Naming/UncommunicativeMethodParamName:
Naming/MethodParameterName:
Exclude:
- 'app/controllers/application_controller.rb'
- 'app/domain/rotation/conjur_facade.rb'
Expand All @@ -624,39 +624,6 @@ Naming/VariableNumber:
Exclude:
- 'spec/models/secret_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
Performance/RedundantBlockCall:
Exclude:
- 'app/domain/rotation/conjur_facade.rb'

# Offense count: 1
# Cop supports --auto-correct.
Performance/RegexpMatch:
Exclude:
- 'cucumber/api/features/support/rest_helpers.rb'

# Offense count: 5
# Cop supports --auto-correct.
Performance/StringReplacement:
Exclude:
- 'app/domain/authentication/authn_k8s/authentication_service.rb'
- 'app/domain/authentication/authn_k8s/authenticator.rb'
- 'cucumber/kubernetes/features/support/world.rb'

# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect.
Performance/TimesMap:
Exclude:
- 'contrib/gen_policy.rb'

# Offense count: 1
# Cop supports --auto-correct.
Performance/UnneededSort:
Exclude:
- 'cucumber/api/features/step_definitions/export_steps.rb'

# Offense count: 2
# Cop supports --auto-correct.
Security/YAMLLoad:
Expand Down Expand Up @@ -693,17 +660,6 @@ Style/BlockDelimiters:
- 'spec/models/role_spec.rb'
- 'spec/support/authentication.rb'

# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: braces, no_braces, context_dependent
Style/BracesAroundHashParameters:
Exclude:
- 'cucumber/rotators/features/support/rotator_helpers.rb'
- 'spec/controllers/authenticate_controller_spec.rb'
- 'spec/models/credentials_spec.rb'
- 'spec/models/host_factory_spec.rb'

# Offense count: 5
# Cop supports --auto-correct.
Style/CharacterLiteral:
Expand Down Expand Up @@ -1263,13 +1219,13 @@ Style/UnlessElse:

# Offense count: 1
# Cop supports --auto-correct.
Style/UnneededInterpolation:
Style/RedundantInterpolation:
Exclude:
- 'app/domain/authentication/authn_k8s/authenticator.rb'

# Offense count: 12
# Cop supports --auto-correct.
Style/UnneededPercentQ:
Style/RedundantPercentQ:
Exclude:
- 'db/migrate/20160705141848_create_authz_functions.rb'
- 'db/migrate/20160815131521_add_policy_column.rb'
Expand Down Expand Up @@ -1303,5 +1259,5 @@ Style/WordArray:
# Offense count: 532
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Layout/LineLength:
Max: 212

0 comments on commit b44e7a1

Please sign in to comment.