turniere-backend/.rubocop.yml

77 lines
1.5 KiB
YAML

plugins:
- rubocop-performance
- rubocop-rails
# Stolen from https://gist.github.com/jhass/a5ae80d87f18e53e7b56
AllCops:
NewCops: disable
SuggestExtensions: false
Exclude:
- "bin/**/*"
- "db/schema.rb"
- "spec/**/*.rb"
# Enable Rails
Rails:
Enabled: true
# Commonly used screens these days easily fit more than 80 characters.
Layout/LineLength:
Max: 140
# Too short methods lead to extraction of single-use methods, which can make
# the code easier to read (by naming things), but can also clutter the class
Metrics/MethodLength:
Exclude:
- "db/migrate/*"
Max: 60
# The guiding principle of classes is SRP, SRP can't be accurately measured by LoC
Metrics/ClassLength:
Max: 1500
Metrics/ModuleLength:
Max: 1500
# Raise AbcSize from 15 to 20
Metrics/AbcSize:
Exclude:
- "db/migrate/*"
Max: 75
Metrics/BlockLength:
Max: 30
AllowedMethods:
- "namespace"
- "create_table"
Exclude:
- "config/**/*.rb"
- "spec/**/*.rb"
Metrics/CyclomaticComplexity:
Max: 22
Metrics/ParameterLists:
Max: 7
Metrics/PerceivedComplexity:
Max: 24
Rails/ReversibleMigration:
Exclude:
- "db/migrate/**/*"
Rails/SkipsModelValidations:
Exclude:
- "app/models/tournament_sync_queue_entry.rb"
- "app/services/tournament_sync_pusher.rb"
- "db/migrate/**/*"
Style/MultilineBlockChain:
Exclude:
- "e2e/lib/api_client.rb"
# Disable documentation checks for now
# should be done with yard instead
Style/Documentation:
Enabled: false