-
Notifications
You must be signed in to change notification settings - Fork 7
/
.rubocop.yml
64 lines (51 loc) · 2.16 KB
/
.rubocop.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#######################################################
## This is intended to be a living document ##
## ##
## If anyone feels that things are too strict: ##
## ##
## Ask "Is the code clearer with or without the rule?" ##
## Then find the rule online and read the rational for it ##
## If you still belive that the code is easier to read, ##
## Disable it below, ALONG WITH A COMMENT SAYING WHY ##
#######################################################
AllCops:
Exclude:
- config/**/*.rb
# modern dev screens are large
Metrics/LineLength:
Max: 100
# 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:
Max: 20
# will probably be the default in ruby 3, so don't bother adding
Style/FrozenStringLiteralComment:
Enabled: false
# don't need to require documenting everything
Documentation:
Enabled: false
# while %i and friends are nice, [] is universally known
Style/SymbolArray:
Enabled: false
# this way the comment is explicitly linked to the line it's referring to
Style/CommentedKeyword:
Enabled: false
# allow multiline {} if the return value is used, clearer then begin/end
Style/BlockDelimiters:
EnforcedStyle: semantic
# Specs tend to be rather large blocks, but that's okay.
Metrics/BlockLength:
ExcludedMethods: ['describe', 'context', 'feature']
#################################
# Linting rules specificallly for RSpec #
#################################
require: rubocop-rspec
# It's common for params hashes to make test examples a bit long but still legible
RSpec/ExampleLength:
Max: 13
# Allow us to use `feature` instead of `describe` in feature specs
Capybara/FeatureMethods:
Enabled: false
# `expect_any_instance_of` is super useful for testing, although, easy to misuse
RSpec/AnyInstance:
Enabled: false