Skip to content

Commit

Permalink
Add exception rules for new cops
Browse files Browse the repository at this point in the history
FactoryBot/FactoryAssociationWithStrategy, exclude spec/factories/legal_aid_applications.rb
This is because there are too many traits that create objects that loop back

RSpec/IndexedLet, set the max number of spec variables to 2

This will allow up to 2 number let variables e.g.
```ruby
    let!(:transaction1) { create(:bank_transaction, :benefits, happened_at: 10.days.ago) }
    let!(:transaction2) { create(:bank_transaction, :benefits, happened_at: 40.days.ago) }
```
But trying to create `transaction3` will raise an error

The aim is to slowly reduce the number over time to 1 as we phase out the use of large numbered blocks

We also exclude spec/services/cfe/* as the CFE classic integration is due to be deleted soon
  • Loading branch information
colinbruce committed Jul 5, 2023
1 parent 6fa7c50 commit 5adeb2e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,12 @@ Lint/AmbiguousBlockAssociation:
Style/ZeroLengthPredicate:
Exclude:
- app/controllers/status_controller.rb

FactoryBot/FactoryAssociationWithStrategy:
Exclude:
- spec/factories/legal_aid_applications.rb # Too many traits create objects that loop back

RSpec/IndexedLet:
Max: 2
Exclude:
- spec/services/cfe/* # due to be deleted soon 🤞

0 comments on commit 5adeb2e

Please sign in to comment.