-
Notifications
You must be signed in to change notification settings - Fork 42
/
.rubocop.yml
122 lines (97 loc) · 2.91 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#
# Our adjustments to rubocop default code policies.
#
# See http://rubocop.readthedocs.io/en/latest/ for detailed configuration options documentation
require:
- rubocop-capybara
- rubocop-performance
- rubocop-rails
# Additional cops for working with RSpec. See https://github.com/backus/rubocop-rspec
- rubocop-rspec
AllCops:
NewCops: enable
Exclude:
- 'tmp/**/*.rb'
# Apparently needed for Travis CI since it bundles into this directory
- 'vendor/bundle/**/*'
Rails:
Enabled: true
Rails/FilePath:
# This used to be the default, so here it stays the default...
EnforcedStyle: arguments
Rails/HttpStatus:
# This is more clear to me at a glance
EnforcedStyle: numeric
# Reads best in my humble opinion
Layout/HashAlignment:
EnforcedColonStyle: table
EnforcedHashRocketStyle: table
Metrics/BlockLength:
Exclude:
# The default guard-rspec config fails this, but it's ok.
- config/routes.rb
- config/environments/*.rb
- 'Guardfile'
- 'spec/**/*_examples.rb'
- 'spec/**/*_spec.rb'
- 'spec/rails_helper.rb'
# Big screens are common :)
Layout/LineLength:
Max: 120
Metrics/MethodLength:
Exclude:
- 'db/migrate/**/*'
# We use RSpec as a format linter, so no specific classes under test neccessarily :)
RSpec/DescribeClass:
Enabled: false
# When setting up message expectations, 5 is frequently too little
RSpec/ExampleLength:
Max: 10
Exclude:
# Not efficient for acceptance tests
- 'spec/features/**/*'
# Default of 5 is a bit too restrictive
RSpec/MultipleMemoizedHelpers:
Max: 10
RSpec/SpecFilePathFormat:
Exclude:
- 'spec/integration/*'
# Prefer to use the up-front message expectations
RSpec/MessageSpies:
Enabled: false
RSpec/MultipleExpectations:
Exclude:
# Not efficient for acceptance tests
- 'spec/features/**/*'
# Prefer structure over small indentation
RSpec/NestedGroups:
Max: 5
# This can lead to more verbose specs without a tangible benefit
RSpec/StubbedMock:
Enabled: false
# See https://github.com/rubocop-hq/rubocop/issues/5953#issuecomment-399973424
# Making attr_accessor & friends private inline is more concise
Style/AccessModifierDeclarations:
Enabled: false
Style/ClassAndModuleChildren:
# Against rails conventions
Enabled: false
Style/Documentation:
Enabled: false
# Prefer to create "real" booleans using double negation
Style/DoubleNegation:
Enabled: false
Style/MixinUsage:
Exclude:
- 'bin/*'
Style/StringLiterals:
EnforcedStyle: double_quotes
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma
# Strict became briefly the default, which was then rolled back to require to be lenient
# again. Since the few occurences were in the meantime already converted to use the strict
# click_link / click_button mode, let's just stick to the more specific approach
Capybara/ClickLinkOrButtonStyle:
EnforcedStyle: strict