mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-03 00:01:21 -04:00
Remi pointed out in #666 that we basically just have to keep adding more more onto the `Max` exception for both these rules every time we add a new API resource. Here I suggest that we modify the check on method length in two ways: 1. Permanently disable the cop on `Util.object_classes`. This is just going to keep growing until we change are approach to it. 2. Choose a more reasonable maximum of 50 lines for elsewhere (IMO, the default of 10 is just too short). Most of our methods already come in below this, but there's a couple outliers like `#execute_request` in `StripeClient`. If we knock over some of those, we could lower this number again, but I suspect that we'd probably want somewhere closer to 30 (instead of 10) event then. I also disable the check on module length completely. I'm not convinced this is a very good heuristic for code quality.
33 lines
677 B
YAML
33 lines
677 B
YAML
inherit_from: .rubocop_todo.yml
|
|
|
|
AllCops:
|
|
DisplayCopNames: true
|
|
TargetRubyVersion: 2.0
|
|
|
|
Layout/CaseIndentation:
|
|
EnforcedStyle: end
|
|
|
|
Layout/IndentArray:
|
|
EnforcedStyle: consistent
|
|
|
|
Layout/IndentHash:
|
|
EnforcedStyle: consistent
|
|
|
|
Metrics/MethodLength:
|
|
# There's ~2 long methods in `StripeClient`. If we want to truncate those a
|
|
# little, we could move this to be closer to ~30 (but the default of 10 is
|
|
# probably too short).
|
|
Max: 50
|
|
|
|
Metrics/ModuleLength:
|
|
Enabled: false
|
|
|
|
Style/FrozenStringLiteralComment:
|
|
EnforcedStyle: always
|
|
|
|
Style/StringLiterals:
|
|
EnforcedStyle: double_quotes
|
|
|
|
Style/TrailingCommaInLiteral:
|
|
EnforcedStyleForMultiline: consistent_comma
|