-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.rubocop.yml
195 lines (145 loc) · 3.19 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
require:
- 'rubocop-rails'
AllCops:
CacheRootDirectory: .
DisabledByDefault: true
Exclude:
- 'db/schema.rb'
- 'db/seeds.rb'
- 'db/migrate/*'
- 'app/lib/geolocator.rb'
- 'bin/*'
# Ignore vendor since we `bundle install --path vendor/bundle` on CI
- 'vendor/**/*'
- 'gems/**/*'
- 'node_modules/**/*'
Layout:
Enabled: true
Style/Documentation:
Enabled: false
Metrics/MethodLength:
Enabled: false
Style/DoubleNegation:
Enabled: false
Layout/LineLength:
Enabled: false
Lint/SuppressedException:
Enabled: false
Layout/EndOfLine:
Enabled: false
Layout/FirstHashElementIndentation:
Enabled: false
Lint/UnderscorePrefixedVariableName:
Enabled: false
Lint:
Enabled: true
Lint/AmbiguousBlockAssociation:
# Exclude specs because rspec is deliberatly using
# a special kind of block styling
Exclude:
- "spec/**/*"
Lint/AssignmentInCondition:
# If you want to assign in the conditional
# then the condition must be surrounded with ()
Enabled: true
AllowSafeAssignment: true
Lint/ConstantDefinitionInBlock:
Exclude:
- "spec/**/*"
Lint/MissingSuper:
Enabled: false
# This clashes with our service pattern
Lint/Void:
Enabled: false
Lint/SafeNavigationChain:
Enabled: false
Style/AndOr:
# && / || instead of and / or
Enabled: true
Style/ArrayJoin:
# use join instead of *
Enabled: true
Style/DoubleNegation:
# Don't use cryptic !! syntax for checking not nil
Enabled: false
Style/MutableConstant:
# Have to freeze potentially mutable constants
Enabled: true
Exclude:
- app/workers/neu/ingest_membership_data_worker.rb
- spec/services/email/render_email_service_spec.rb
Rails/TimeZone:
Enabled: true
Exclude:
- spec/controllers/api/twilio_controller_spec.rb
- spec/services/utility/opening_hours_service_spec.rb
Style/Not:
# !x instead of (not x)
Enabled: true
Naming/ClassAndModuleCamelCase:
Enabled: true
Naming/ConstantName:
# SCREAMING_SNAKE_CASE
Enabled: true
Naming/FileName:
Enabled: true
Naming/MethodName:
Enabled: true
Naming/VariableName:
Enabled: true
Rails:
Enabled: true
Rails/ActiveRecordAliases:
Enabled: true
Rails/Blank:
Enabled: true
Rails/Date:
Enabled: true
Rails/DynamicFindBy:
Enabled: true
Whitelist:
- find_by_sql
- find_by_phone
- find_by_external_id
- find_by_name
Rails/EnumUniqueness:
Enabled: true
Rails/EnvironmentComparison:
Enabled: true
Rails/Exit:
Enabled: true
Rails/FilePath:
Enabled: false
Rails/FindBy:
Enabled: false
Rails/InverseOf:
Enabled: false
Rails/PluralizationGrammar:
Enabled: true
Rails/Presence:
Enabled: true
Rails/Present:
Enabled: true
Rails/RequestReferer:
Enabled: true
Rails/SafeNavigation:
Enabled: true
Rails/SaveBang:
Enabled: true
AllowedReceivers:
- Stripe::Charge
- Twilio::REST::Client::Messaging
- Twilio::REST::Client::Addresses
- Twilio::REST::Client::IncomingPhoneNumbers
Exclude:
- spec/validators/search_rules_validator_spec.rb
Rails/HelperInstanceVariable:
Enabled: false
Rails/ScopeArgs:
Enabled: true
Rails/SkipsModelValidations:
Enabled: false
Rails/UnknownEnv:
Enabled: true
Rails/UniqueValidationWithoutIndex:
Enabled: false