-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update rubocop config + update bosh template spec tests (#394)
* Update routing's rubocop configuration I tried to run rubocop the other day and it was an absolute mess. This PR updates the rubocop config in routing-release and updates all of the bosh template spec tests appropriately. The update strategy is based on what exists in CAPI and this PR specifically: - cloudfoundry/cloud_controller_ng#3448 * Enable `rubocop-rspec` and regen rubocop_todo.yml We'll get this these... eventually... maybe.
- Loading branch information
Showing
11 changed files
with
244 additions
and
90 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# We put our own configuration into .rubocop_routing.yml to let it be | ||
# overwritten buy .rubocop_todo.yml. | ||
# The .rubocop_todo.yml is autogenerated with `rubocop --regenerate-todo` and | ||
# ignores old errors for new cops | ||
# Then one can, one by one, remove to ignore from the .rubocop_todo.yml file | ||
# and work on applying new cops also to old codebase. | ||
# | ||
# This was adapted from [cloudfoundry/cloud_controller_ng](https://github.com/cloudfoundry/cloud_controller_ng/blob/a6febf66cf9cf7c86b27b917df9b111b874b6972/.rubocop.yml) | ||
|
||
inherit_from: | ||
- .rubocop_routing.yml | ||
- .rubocop_todo.yml | ||
inherit_mode: | ||
merge: | ||
- Exclude | ||
- Include |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Routing Release rubocop config for bosh template tests | ||
|
||
require: | ||
- rubocop-rspec | ||
|
||
AllCops: | ||
TargetRubyVersion: 3.2 | ||
NewCops: enable | ||
|
||
Layout/LineLength: | ||
Max: 200 | ||
|
||
Metrics/BlockLength: | ||
Exclude: | ||
- 'spec/**/*' | ||
Max: 50 | ||
|
||
Metrics/MethodLength: | ||
Max: 60 | ||
|
||
Style/MutableConstant: | ||
EnforcedStyle: literals | ||
|
||
Style/FrozenStringLiteralComment: | ||
EnforcedStyle: always_true | ||
Exclude: | ||
- 'Gemfile' | ||
- 'scripts/staged_shortlog' | ||
|
||
Style/Documentation: | ||
Exclude: | ||
- spec/spec_helper.rb | ||
|
||
Style/SelectByRegexp: | ||
Exclude: | ||
- 'scripts/staged_shortlog' |
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 |
---|---|---|
@@ -0,0 +1,133 @@ | ||
# This configuration was generated by | ||
# `rubocop --auto-gen-config` | ||
# on 2024-03-06 23:41:06 UTC using RuboCop version 1.57.1. | ||
# 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: 36 | ||
# This cop supports unsafe autocorrection (--autocorrect-all). | ||
RSpec/BeEq: | ||
Exclude: | ||
- 'spec/gorouter_templates_spec.rb' | ||
- 'spec/routing_api_templates_spec.rb' | ||
|
||
# Offense count: 50 | ||
# Configuration parameters: Prefixes, AllowedPatterns. | ||
# Prefixes: when, with, without | ||
RSpec/ContextWording: | ||
Exclude: | ||
- 'spec/gorouter_templates_spec.rb' | ||
- 'spec/haproxy_config_spec.rb' | ||
- 'spec/routing_api_templates_spec.rb' | ||
|
||
# Offense count: 5 | ||
# Configuration parameters: IgnoredMetadata. | ||
RSpec/DescribeClass: | ||
Exclude: | ||
- 'spec/gorouter_templates_spec.rb' | ||
- 'spec/haproxy_config_spec.rb' | ||
- 'spec/route_registar_templates_spec.rb' | ||
- 'spec/routing_api_templates_spec.rb' | ||
- 'spec/tcp_router_templates_spec.rb' | ||
|
||
# Offense count: 14 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: AllowConsecutiveOneLiners. | ||
RSpec/EmptyLineAfterExample: | ||
Exclude: | ||
- 'spec/gorouter_templates_spec.rb' | ||
- 'spec/route_registar_templates_spec.rb' | ||
|
||
# Offense count: 38 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
RSpec/EmptyLineAfterExampleGroup: | ||
Exclude: | ||
- 'spec/gorouter_templates_spec.rb' | ||
- 'spec/route_registar_templates_spec.rb' | ||
- 'spec/tcp_router_templates_spec.rb' | ||
|
||
# Offense count: 12 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
RSpec/EmptyLineAfterFinalLet: | ||
Exclude: | ||
- 'spec/gorouter_templates_spec.rb' | ||
- 'spec/route_registar_templates_spec.rb' | ||
- 'spec/routing_api_templates_spec.rb' | ||
- 'spec/tcp_router_templates_spec.rb' | ||
|
||
# Offense count: 56 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: AllowConsecutiveOneLiners. | ||
RSpec/EmptyLineAfterHook: | ||
Exclude: | ||
- 'spec/gorouter_templates_spec.rb' | ||
- 'spec/route_registar_templates_spec.rb' | ||
- 'spec/tcp_router_templates_spec.rb' | ||
|
||
# Offense count: 13 | ||
# Configuration parameters: CountAsOne. | ||
RSpec/ExampleLength: | ||
Max: 47 | ||
|
||
# Offense count: 108 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: CustomTransform, IgnoredWords, DisallowedExamples. | ||
# DisallowedExamples: works | ||
RSpec/ExampleWording: | ||
Exclude: | ||
- 'spec/gorouter_templates_spec.rb' | ||
- 'spec/route_registar_templates_spec.rb' | ||
- 'spec/routing_api_templates_spec.rb' | ||
- 'spec/spec_helper.rb' | ||
- 'spec/tcp_router_templates_spec.rb' | ||
|
||
# Offense count: 7 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
RSpec/LeadingSubject: | ||
Exclude: | ||
- 'spec/gorouter_templates_spec.rb' | ||
- 'spec/routing_api_templates_spec.rb' | ||
- 'spec/tcp_router_templates_spec.rb' | ||
|
||
# Offense count: 1 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
RSpec/MatchArray: | ||
Exclude: | ||
- 'spec/gorouter_templates_spec.rb' | ||
|
||
# Offense count: 34 | ||
RSpec/MultipleExpectations: | ||
Max: 5 | ||
|
||
# Offense count: 254 | ||
# Configuration parameters: AllowSubject. | ||
RSpec/MultipleMemoizedHelpers: | ||
Max: 10 | ||
|
||
# Offense count: 179 | ||
# Configuration parameters: AllowedGroups. | ||
RSpec/NestedGroups: | ||
Max: 7 | ||
|
||
# Offense count: 4 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: EnforcedStyle. | ||
# SupportedStyles: not_to, to_not | ||
RSpec/NotToNot: | ||
Exclude: | ||
- 'spec/gorouter_templates_spec.rb' | ||
- 'spec/haproxy_config_spec.rb' | ||
|
||
# Offense count: 4 | ||
RSpec/RepeatedExampleGroupBody: | ||
Exclude: | ||
- 'spec/tcp_router_templates_spec.rb' | ||
|
||
# Offense count: 6 | ||
RSpec/RepeatedExampleGroupDescription: | ||
Exclude: | ||
- 'spec/gorouter_templates_spec.rb' | ||
- 'spec/route_registar_templates_spec.rb' | ||
- 'spec/tcp_router_templates_spec.rb' |
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.