Skip to content

Commit

Permalink
Fix Rubocop offenses (#2296)
Browse files Browse the repository at this point in the history
* Rerun rubocop --auto-gen-config with --auto-gen-only-exclude --exclude-limit 5000
Move metrics cops in rubocop
Fix Performance/CollectionLiteralInLoop
Fix Performance/MethodObjectAsBlock
Fix RSpec/ClassCheck
Fix RSpec/EmptyExampleGroup
Fix RSpec/IdenticalEqualityAssertion
Fix RSpec/IteratedExpectation
Fix RSpec/LetSetup
Fix Style/MagicCommentFormat
Fix Style/MapToHash
Fix Style/SafeNavigation
Fix Style/SlicingWithRange
Enabled Lint/ConstantDefinitionInBlock
Enabled Lint/EmptyBlock
Enabled RSpec/ContextWording
Enabled RSpec/FilePath
Enabled RSpec/LeakyConstantDeclaration
Enabled RSpec/NamedSubject

* Add CHANGELOG.md

* Add # rubocop:disable RSpec/IteratedExpectation because Rack::Response does not respond to :each_with_index
  • Loading branch information
ericproulx authored Dec 27, 2022
1 parent 5e8cd2a commit 02fd374
Show file tree
Hide file tree
Showing 17 changed files with 386 additions and 224 deletions.
35 changes: 27 additions & 8 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ require:

inherit_from: .rubocop_todo.yml

Layout/LineLength:
Max: 215

Style/Documentation:
Enabled: false

Expand All @@ -21,18 +24,34 @@ Style/MultilineIfModifier:
Style/RaiseArgs:
Enabled: false

Style/HashEachMethods:
Enabled: true

Style/HashTransformKeys:
Enabled: true

Style/HashTransformValues:
Enabled: true
Metrics/AbcSize:
Max: 45

Metrics/BlockLength:
Max: 30
Exclude:
- spec/**/*_spec.rb

Metrics/ClassLength:
Max: 300

Metrics/CyclomaticComplexity:
Max: 15

Metrics/ParameterLists:
MaxOptionalParameters: 4

Metrics/MethodLength:
Max: 32

Metrics/ModuleLength:
Max: 220

Metrics/PerceivedComplexity:
Max: 15

RSpec/Capybara/FeatureMethods:
Enabled: false

RSpec/ExampleLength:
Max: 60
Loading

0 comments on commit 02fd374

Please sign in to comment.