-
Notifications
You must be signed in to change notification settings - Fork 5
/
.rubocop.yml
189 lines (139 loc) · 3.66 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
inherit_gem:
rubocop-govuk:
- config/default.yml
- config/rails.yml
- config/rspec.yml
require:
- rubocop-rspec
- rubocop-rails
AllCops:
# Exclude anything that isn't really part of our code.
# rails_helper is excluded because it's full of solecisms, but it's mostly
# generated code and copy-and-pasted snippets from READMEs.
Exclude:
- 'vendor/**/*'
- 'db/**/*'
- 'bin/**/*'
- '**/Rakefile'
- 'spec/rails_helper.rb'
- 'spec/factories/*.rb'
Style/MultilineBlockChain:
Enabled: false
Style/SymbolArray:
Enabled: false
# Enforce single quotes everywhere except in specs (because there's a lot of
# human text with apostrophes in spec names, and using double quotes for all
# of those is more consistent. There shouldn't be much human-readable text in
# the application code: that is better moved to the locale files.
Style/StringLiterals:
EnforcedStyle: single_quotes
Exclude:
- 'spec/**/*'
RSpec/AnyInstance:
Enabled: false
Bundler/OrderedGems:
Enabled: false
Metrics/BlockLength:
# This is only 2 more than the default, and the transgressor just proves that rubocop can't count.
Max: 27
Exclude:
- 'config/environments/*'
- 'Guardfile'
- 'app/admin/*'
- 'lib/tasks/*'
- 'spec/**/*'
RSpec/ExampleLength:
Max: 150
RSpec/HookArgument:
Enabled: false
RSpec/ExpectInHook:
Enabled: false
RSpec/LetSetup:
Enabled: false
RSpec/MessageSpies:
Enabled: false
RSpec/MultipleExpectations:
Max: 20
RSpec/NamedSubject:
Enabled: false
RSpec/NestedGroups:
Max: 8
RSpec/ScatteredSetup:
Enabled: false
RSpec/SubjectStub:
Enabled: false
RSpec/EmptyExampleGroup:
Exclude:
# The DescribeClass cop has been disabled as it is insists that the describe
# block contain the name of the tested class. However rswag is using this
# text as part of the API documentation generated from these tests.
- 'spec/api/**/*_spec.rb'
RSpec/VerifiedDoubles:
Enabled: false
RSpec/VariableName:
Exclude:
# Authorization 'method' needs to be defined for rswag
- 'spec/api/**/*_spec.rb'
Rails/FilePath:
Enabled: false
Rails/OutputSafety:
Enabled: false
Rails/SaveBang:
Enabled: false
Security/YAMLLoad:
Enabled: false
Layout/ExtraSpacing:
Enabled: false
Layout/MultilineArrayBraceLayout:
Enabled: false
Layout/MultilineHashBraceLayout:
Enabled: false
Layout/MultilineMethodCallBraceLayout:
Enabled: false
Layout/MultilineOperationIndentation:
Enabled: false
Style/NestedParenthesizedCalls:
Enabled: false
Style/NumericPredicate:
Enabled: false
Style/TernaryParentheses:
Enabled: false
Lint/UselessAccessModifier:
Enabled: false
Lint/IneffectiveAccessModifier:
Enabled: false
RSpec/Capybara:
Enabled: false
# In a view spec, the top level describe must be the view that is rendered
RSpec/MultipleDescribes:
Exclude:
- 'spec/views/handovers/columns_spec.rb'
RSpec/MultipleMemoizedHelpers:
Enabled: false
RSpec/StubbedMock:
Enabled: false
RSpec/DescribeMethod:
Enabled: false
RSpec/PredicateMatcher:
Enabled: false
RSpec/ExampleWording:
Enabled: false
# Below here is the set of (arbitrary) style failures against the govuk versions
Style/WordArray:
Enabled: false
Style/TrailingCommaInHashLiteral:
Enabled: false
Style/TrailingCommaInArguments:
Enabled: false
Style/TrailingCommaInArrayLiteral:
Enabled: false
Style/MethodCalledOnDoEndBlock:
Enabled: false
Style/EachForSimpleLoop:
Enabled: false
# We don't want anyone to have to know that an `if` statement evaluates to nil if none of its conditions are met,
# so we allow `else nil` so it's crystal clear
Style/EmptyElse:
Enabled: false
Style/HashSyntax:
EnforcedShorthandSyntax: either