-
Notifications
You must be signed in to change notification settings - Fork 3
/
.rubocop.yml
264 lines (254 loc) · 5.71 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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
AllCops:
TargetRubyVersion: 3.2.2
Exclude:
- 'Guardfile'
- 'vendor/**/*'
- 'db/**/*'
- 'bin/**/*'
- '**/*.gemspec'
- '**/Rakefile'
- '**/Vagrantfile'
- 'spec/rails_helper.rb'
- 'lib/tasks/cucumber.rake'
- 'features/support/env.rb'
- 'script/cucumber'
- 'lib/log_stuff.rb'
- 'config/routes.rb'
- 'Gemfile'
- 'spec/support/**/*'
- 'node_modules/**/*'
# Metrics
Metrics/ClassLength:
Exclude:
- 'app/forms/**/*'
- 'features/support/page_objects/**/*'
- 'features/support/sections/**/*'
Metrics/ModuleLength:
Exclude:
- 'spec/forms/**/*'
- 'features/support/page_objects/**/*'
- 'features/support/sections/**/*'
Metrics/AbcSize:
Exclude:
- 'spec/**/*'
Max: 20
Metrics/MethodLength:
Exclude:
- 'spec/**/*'
- 'app/models/ability.rb'
- 'config/initializers/markdown_handler.rb'
Metrics/BlockLength:
Exclude:
- 'config/environments/*.rb'
- '**/*.jbuilder'
Max: 25
# Style
Style/BlockDelimiters:
Enabled: true
Exclude:
- 'spec/**/*'
Style/ClassAndModuleChildren:
Enabled: false
Style/CollectionMethods:
Enabled: false
Style/DotPosition:
EnforcedStyle: trailing
Style/EachWithObject:
Enabled: false
Style/EmptyLines:
Enabled: true
Style/EmptyLineAfterGuardClause:
Enabled: true
Style/EmptyLineAfterMagicComment:
Enabled: false
Style/ExtraSpacing:
Enabled: true
Style/FrozenStringLiteralComment:
Enabled: false
Style/FormatString:
Enabled: false
Style/FormatStringToken:
EnforcedStyle: annotated
Style/HashSyntax:
Enabled: true
Exclude:
- 'spec/features/attaching_a_document_spec.rb'
Style/MutableConstant:
Enabled: true
Style/NumericPredicate:
Exclude:
- 'spec/**/*'
Style/ParameterAlignment:
EnforcedStyle: with_fixed_indentation
Style/PercentLiteralDelimiters:
PreferredDelimiters:
'%w': '[]'
'%W': '[]'
'%i': '[]'
Style/RegexpLiteral:
Enabled: false
Style/StringConcatenation:
Enabled: true
Style/StringLiterals:
Enabled: false
Style/SymbolArray:
EnforcedStyle: brackets
Style/TrailingCommaInHashLiteral:
Enabled: true
Style/TrivialAccessors:
AllowPredicates: true
Style/WordArray:
EnforcedStyle: brackets
# Lint
Lint/AssignmentInCondition:
AllowSafeAssignment: false
Lint/ConstantDefinitionInBlock:
Enabled: true
Lint/EmptyFile:
Exclude:
- 'config/nulldb_schema.rb'
Lint/IneffectiveAccessModifier:
Enabled: true
Lint/MissingCopEnableDirective:
Enabled: true
Lint/UnusedMethodArgument:
Enabled: true
Lint/UselessAccessModifier:
Enabled: true
# Documentation
Documentation:
Description: Document classes and non-namespace modules.
Enabled: false
# RSpec
RSpec/DescribeClass:
Exclude:
- spec/support/**/*
- spec/views/**/*
RSpec/EmptyLineAfterExampleGroup:
Enabled: true
RSpec/EmptyLineAfterFinalLet:
Enabled: true
RSpec/ExampleLength:
Exclude:
- 'spec/**/*'
RSpec/ExampleWording:
Enabled: true
RSpec/ExpectActual:
Exclude:
- 'spec/routing/**/*'
RSpec/ExpectInHook:
Enabled: true
RSpec/FilePath:
Exclude:
- 'spec/services/carrierwave_filename_spec.rb'
RSpec/LeakyConstantDeclaration:
Enabled: true
RSpec/LetBeforeExamples:
Enabled: true
RSpec/MultipleExpectations:
Exclude:
- 'spec/features/**/*'
RSpec/NamedSubject:
Enabled: true
RSpec/NotToNot:
Enabled: true
RSpec/RepeatedDescription:
Enabled: true
RSpec/ScatteredSetup:
Enabled: true
Exclude:
- "spec/features/create_claim_applications_spec.rb"
RSpec/StubbedMock:
Enabled: true
RSpec/NestedGroups:
Max: 10
RSpec/VerifiedDoubles:
Exclude:
- 'spec/forms/refunds/**/*_spec.rb'
RSpec/MessageSpies:
EnforcedStyle: receive
RSpec/MultipleMemoizedHelpers:
Exclude:
- 'spec/views/claim_reviews/show/review_page_employment_spec.rb'
- 'spec/models/stats/claim_stats_spec.rb'
- 'spec/forms/refunds/review_form_spec.rb'
- 'spec/forms/refunds/confirmation_form_spec.rb'
- 'spec/forms/additional_claimants_upload_form_spec.rb'
- 'spec/features/terms_spec.rb'
- 'spec/features/guide_spec.rb'
- 'spec/features/create_claim_applications_spec.rb'
- 'spec/features/attaching_a_document_spec.rb'
# Capybara
Capybara/CurrentPathExpectation:
Enabled: true
# Rails
Rails/Blank:
Enabled: true
Exclude:
- 'app/views/api/claim/_build_primary_representative.json.jbuilder'
- 'app/controllers/claims_controller.rb'
Rails/Date:
Enabled: true
Rails/FilePath:
Enabled: true
Rails/LexicallyScopedActionFilter:
Enabled: true
Exclude:
- 'app/controllers/save_and_return/sessions_controller.rb'
Rails/SkipsModelValidations:
Enabled: false
Rails/InverseOf:
Enabled: false
Rails/HasManyOrHasOneDependent:
Enabled: false
# Layout
Layout/AccessModifierIndentation:
EnforcedStyle: indent
Layout/BlockAlignment:
Enabled: true
Layout/EmptyLinesAroundBlockBody:
Enabled: false
Layout/EmptyLinesAroundClassBody:
Enabled: false
Layout/EmptyLinesAroundModuleBody:
Enabled: false
Layout/EmptyLineAfterGuardClause:
Enabled: true
Layout/EmptyLines:
Enabled: true
Layout/ExtraSpacing:
Enabled: true
Layout/InitialIndentation:
Enabled: true
Layout/LeadingEmptyLines:
Enabled: true
Layout/LineLength:
Max: 120
Exclude:
- 'features/**/*'
- 'spec/**/*'
- 'Gemfile'
- 'import-secrets.rb'
- 'config/initializers/devise.rb'
- 'config/environments/*.rb'
- 'app/validators/ccd_phone_validator.rb'
Layout/MultilineMethodCallIndentation:
Enabled: true
Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation
Layout/SpaceInsideArrayLiteralBrackets:
Enabled: true
Layout/TrailingEmptyLines:
Enabled: true
# Naming
Naming/FileName:
Exclude:
- "import-secrets.rb"
Naming/PredicateName:
Enabled: false
require:
- rubocop-rspec
- rubocop-rails
- rubocop-capybara
- rubocop-factory_bot
- rubocop-rspec_rails