-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.rubocop.yml
310 lines (253 loc) · 8.12 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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
require:
- rubocop-rspec
- rubocop-performance
- rubocop-rails
- rubocop-thread_safety
- rubocop-graphql
AllCops:
DisplayStyleGuide: true
Exclude:
- 'bin/**/*'
- 'db/schema.rb'
- 'db/*_schema.rb'
Layout/BlockAlignment:
Description: 'Align block ends correctly.'
Enabled: true
# The value `start_of_block` means that the `end` should be aligned with line
# where the `do` keyword appears.
EnforcedStyleAlignWith: start_of_block
Layout/ClassStructure:
Description: 'Enforces a configured order of definitions within a class body.'
Enabled: true
Categories:
module_inclusion:
- include
- prepend
- extend
ExpectedOrder:
- module_inclusion
- constants
- public_class_methods
- initializer
- public_methods
- protected_methods
- private_methods
Layout/EndAlignment:
Description: 'Align ends correctly.'
Enabled: true
# The value `variable` means that in assignments, `end` should be aligned
# with the start of the variable on the left hand side of `=`. In all other
EnforcedStyleAlignWith: variable
Layout/FirstArrayElementLineBreak:
Description: 'Checks for a line break before the first element in a multi-line array.'
Enabled: true
Layout/FirstHashElementLineBreak:
Description: 'Checks for a line break before the first element in a multi-line hash.'
Enabled: true
Layout/FirstMethodArgumentLineBreak:
Description: 'Checks for a line break before the first argument in a multi-line method call.'
Enabled: true
Layout/FirstMethodParameterLineBreak:
Description: 'Checks for a line break before the first parameter in a multi-line method parameter definition.'
Enabled: true
Layout/FirstArgumentIndentation:
Description: 'Checks the indentation of the first argument in a method call.'
Enabled: true
# The first parameter should always be indented one level relative to the
# parent that is receiving the parameter
EnforcedStyle: consistent
Layout/FirstArrayElementIndentation:
Description: 'Checks the indentation of the first element in an array literal.'
Enabled: true
# The value `consistent` means that the indentation of the first element shall
# always be relative to the first position of the line where the opening
# bracket is.
EnforcedStyle: consistent
Layout/FirstHashElementIndentation:
Description: 'Checks the indentation of the first key in a hash literal.'
Enabled: true
# The value `consistent` means that the indentation of the first key shall
# always be relative to the first position of the line where the opening
# brace is.
EnforcedStyle: consistent
Layout/LineLength:
Description: 'Limit lines to 120 characters.'
Enabled: true
Max: 120
Layout/MultilineArrayLineBreaks:
Description: 'Checks that each item in a multi-line array literal starts on a separate line.'
Enabled: true
Layout/MultilineAssignmentLayout:
Description: 'Check for a newline after the assignment operator in multi-line assignments.'
Enabled: true
# Ensures that the assignment operator and the rhs are on the same line for
# the set of supported types.
EnforcedStyle: same_line
Layout/MultilineHashKeyLineBreaks:
Description: 'Checks that each item in a multi-line hash literal starts on a separate line.'
Enabled: true
Layout/MultilineMethodArgumentLineBreaks:
Description: 'Checks that each argument in a multi-line method call starts on a separate line.'
Enabled: true
Layout/MultilineMethodCallIndentation:
Description: 'Checks indentation of method calls with the dot operator that span more than one line.'
Enabled: true
EnforcedStyle: indented
Lint/AmbiguousBlockAssociation:
Description: 'Checks for ambiguous block association with method when param passed without parentheses.'
Enabled: true
Exclude:
- 'spec/**/*'
Metrics/AbcSize:
Enabled: false
Metrics/BlockLength:
Enabled: false
Metrics/ClassLength:
Enabled: false
Metrics/CyclomaticComplexity:
Enabled: false
Metrics/MethodLength:
Enabled: false
Metrics/ModuleLength:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
Naming/PredicateName:
Enabled: false
Performance/CaseWhenSplat:
Enabled: true
Rails/InverseOf:
Description: 'Checks for associations where the inverse cannot be determined automatically.'
Enabled: false
Rails/HttpStatus:
Description: 'Enforces use of symbolic or numeric value to describe HTTP status.'
Enabled: false
Rails/HasManyOrHasOneDependent:
Description: 'Forces a "dependent" options for has_one and has_many rails relations.'
Enabled: false
RSpec/ExampleLength:
Description: 'Checks for long examples.'
Enabled: false
RSpec/MultipleExpectations:
Description: 'Checks if examples contain too many expect calls.'
Enabled: false
RSpec/MultipleMemoizedHelpers:
Enabled: false
RSpec/NestedGroups:
Enabled: false
Style/BlockDelimiters:
Description: >-
Avoid using {...} for multi-line blocks (multiline chaining is always ugly).
Prefer {...} over do...end for single-line blocks.
Enabled: true
EnforcedStyle: line_count_based
AllowedMethods:
- lambda
- proc
- it
- expect
- change
Style/CommentAnnotation:
Description: 'Checks formatting of special comments (TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE, INFO).'
Enabled: true
Keywords:
- TODO
- FIXME
- OPTIMIZE
- HACK
- REVIEW
- NOTE
- INFO
Style/Documentation:
Enabled: false
Style/MethodCallWithArgsParentheses:
Description: 'Use parentheses for method calls with arguments.'
Enabled: true
IgnoreMacros: true
AllowedMethods:
- require_relative
- require
- load
- raise
- desc
- yield
- puts
AllowParenthesesInMultilineCall: false
AllowParenthesesInChaining: false
AllowParenthesesInCamelCaseMethod: false
EnforcedStyle: require_parentheses
Exclude:
- 'lib/tasks/**/*'
- 'db/**/*'
- 'spec/**/*'
- 'config.ru'
- 'Gemfile'
- '**/rspec/**/*.rb'
Style/NestedParenthesizedCalls:
Description: >-
Parenthesize method calls which are nested inside the
argument list of another parenthesized method call.
Enabled: true
AllowedMethods: []
Style/OneLineConditional:
Description: 'Favor the ternary operator(?:) over if/then/else/end constructs.'
Enabled: false
Style/Send:
Description: >-
Prefer `Object#__send__` or `Object#public_send` to `send`,
as `send` may overlap with existing methods.
Enabled: true
Style/SymbolArray:
Description: 'Use %i or %I for arrays of symbols.'
Enabled: false
Style/TrailingCommaInArguments:
Description: 'Checks for trailing comma in argument lists.'
StyleGuide: '#no-trailing-params-comma'
Enabled: true
VersionAdded: '0.36'
# If `comma`, the cop requires a comma after the last argument, but only for
# parenthesized method calls where each argument is on its own line.
# If `consistent_comma`, the cop requires a comma after the last argument,
# for all parenthesized method calls with arguments.
EnforcedStyleForMultiline: comma
SupportedStylesForMultiline:
- comma
- consistent_comma
- no_comma
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma
Style/TernaryParentheses:
Description: 'Checks for use of parentheses around ternary conditions.'
Enabled: true
EnforcedStyle: require_parentheses_when_complex
Style/GlobalVars:
Description: 'Do not introduce global variables.'
StyleGuide: '#instance-vars'
Reference: 'https://www.zenspider.com/ruby/quickref.html'
Enabled: true
VersionAdded: '0.13'
# Built-in global variables are allowed by default.
AllowedVariables: ['$segment_client', '$json_web_token']
Style/ClassAndModuleChildren:
Exclude:
- 'test/**/*'
Lint/RaiseException:
Enabled: false
Lint/StructNewOverride:
Enabled: false
Style/HashEachMethods:
Enabled: false
Style/HashTransformKeys:
Enabled: false
Style/HashTransformValues:
Enabled: false
GraphQL/ArgumentDescription:
Enabled: false
GraphQL/FieldDescription:
Enabled: false
GraphQL/ObjectDescription:
Enabled: false
GraphQL/ExtractType:
Enabled: false