This repository has been archived by the owner on Jan 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.rubocop.yml
193 lines (147 loc) · 4.11 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
inherit_gem:
rubocop-govuk:
- config/default.yml
- config/rails.yml
require:
- rubocop-rspec
- ./lib/rubocop/cop/lint/unknown_feature_flag.rb
AllCops:
Exclude:
- 'Rakefile'
- 'bin/*'
- 'db/schema.rb'
- 'node_modules/**/*'
- 'config/application.rb'
- 'config/boot.rb'
- 'config/puma.rb'
- 'config/environments/*'
- 'config/initializers/nationalities.rb'
- 'config/initializers/canonical_rails.rb'
- 'config/spring.rb'
- 'lib/tasks/cucumber.rake'
- 'lib/tasks/govuk_lint.rake'
- 'features/support/env.rb'
- 'spec/spec_helper.rb'
- 'vendor/**/*'
Rails/BulkChangeTable:
Enabled: false
Style/AndOr:
EnforcedStyle: conditionals
Style/StringLiterals:
Enabled: true
EnforcedStyle: single_quotes
Bundler/OrderedGems:
Enabled: false
Metrics/BlockLength:
Enabled: false
RSpec/ExampleLength:
Enabled: false
RSpec/MultipleExpectations:
Enabled: false
RSpec/ContextWording:
Enabled: false
# we have a property called "subject" in some factories
RSpec/EmptyLineAfterSubject:
Exclude:
- 'spec/factories.rb'
# The Pundit RSpec DSL triggers this cop false positively
# Although this may be resolved fairly soon, see https://github.com/rubocop-hq/rubocop-rspec/issues/333
RSpec/RepeatedExample:
Exclude:
- 'spec/policies/**/*'
# The Pundit RSpec DSL triggers this cop false positively
# Although this may be resolved fairly soon, see https://github.com/rubocop-hq/rubocop-rspec/issues/333
RSpec/RepeatedDescription:
Exclude:
- 'spec/policies/**/*'
Naming/MethodParameterName:
AllowedNames:
- e
- to
RSpec/Capybara/FeatureMethods:
EnabledMethods:
- feature
- scenario
# It's better to be explicit about the class that's being tested
RSpec/DescribedClass:
Enabled: false
# This cop wants us to use `expect().to change(Candidate, :count)` instead
# of `expect().to change { Candidate.count }`, which doesn't seem better.
RSpec/ExpectChange:
Enabled: false
RSpec/LeadingSubject:
Enabled: false
# In acceptance tests it's often handy to user instance variables to keep track of state
RSpec/InstanceVariable:
Enabled: false
RSpec/PredicateMatcher:
Enabled: false
RSpec/DescribeClass:
Enabled: false
RSpec/VariableDefinition:
Exclude:
- spec/mailers/log_email_delivery_observer_spec.rb
RSpec/VariableName:
Exclude:
- spec/mailers/log_email_delivery_observer_spec.rb
Lint/AmbiguousBlockAssociation:
Exclude:
- 'spec/system/support_interface/daily_report_spec.rb'
- 'spec/requests/vendor_api/api_authentication_spec.rb'
# We don't want to subclass from ApplicationController. This enables separation
# between the namespaces, and allows subclassing from ActionController::API in
# the Vendor API.
Rails/ApplicationController:
Enabled: false
# We don't use ApplicationRecord
Rails/ApplicationRecord:
Enabled: false
# Rails doesn't actually allow "dynamic find_by", so this cop yields false positives
# like `VendorApiToken.find_by_unhashed_token` (which we implement ourselves)
Rails/DynamicFindBy:
Enabled: false
# Not all rake tasks need :environment
Rails/RakeEnvironment:
Enabled: false
# This cop demands a default value for not-null columns, which isn't possible
# when dealing with references
Rails/NotNullColumn:
Enabled: false
Naming/MemoizedInstanceVariableName:
Enabled: false
# Pending cops
# These will be enabled by default at Rubocop 1.0
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
Rake/Desc:
Exclude:
- 'lib/tasks/reset_qa.rake'
RSpec/NestedGroups:
Max: 5
Rails/Output:
Exclude:
- 'app/services/importers/*'
# After introducing gem 'rubocop-govuk', '~> 4.0.0.pre.1'
# These should be reviewed individually and decided if on their enforcement
Lint/MissingSuper:
Enabled: false
RSpec/MultipleMemoizedHelpers:
Enabled: false
Naming/VariableNumber:
Enabled: false
Style/StringConcatenation:
Enabled: false
Style/CaseLikeIf:
Enabled: false
Lint/RedundantSafeNavigation:
Enabled: false
Style/SlicingWithRange:
Enabled: false
Security/Open:
Enabled: false
RSpec/FilePath:
Enabled: false