-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
305 lines (228 loc) · 8.14 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
AllCops:
DisabledByDefault: true
TargetRubyVersion: 2.4
DisplayStyleGuide: true
ExtraDetails: false
Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: space
EnforcedStyleForEmptyBraces: no_space
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: no_comma
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: no_comma
Style/HashSyntax:
EnforcedStyle: ruby19
Layout/TrailingWhitespace:
Enabled: true
Layout/EmptyLines:
Enabled: true
Layout/IndentationConsistency:
Enabled: true
Layout/BlockAlignment:
Enabled: true
Layout/DefEndAlignment:
Enabled: true
Layout/AlignArray:
Enabled: true
Layout/AlignHash:
Enabled: true
Layout/AlignParameters:
Enabled: true
Layout/BlockEndNewline:
Enabled: true
Style/BlockDelimiters:
Enabled: true
Naming/ClassAndModuleCamelCase:
Enabled: true
Style/ClassMethods:
Enabled: true
Style/ClassVars:
Enabled: true
Layout/CommentIndentation:
Enabled: true
Style/ConditionalAssignment:
Enabled: true
Naming/ConstantName:
Enabled: true
Style/DefWithParentheses:
Enabled: true
Style/PreferredHashMethods:
Enabled: true
Style/EachForSimpleLoop:
Enabled: true
Layout/ElseAlignment:
Enabled: true
Style/EmptyElse:
Enabled: true
Style/EmptyCaseCondition:
Enabled: true
Layout/EmptyLineBetweenDefs:
Description: 'Use empty lines between defs.'
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#empty-lines-between-methods'
Enabled: true
Layout/EmptyLines:
Enabled: true
Layout/EmptyLinesAroundClassBody:
Enabled: true
Style/EmptyLiteral:
Description: 'Prefer literals to Array.new/Hash.new/String.new.'
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#literal-array-hash'
Enabled: true
Layout/ExtraSpacing:
Enabled: true
Naming/FileName:
Enabled: true
Layout/IndentationWidth:
Description: 'Use 2 spaces for indentation.'
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#spaces-indentation'
Enabled: true
Layout/LeadingCommentSpace:
Description: 'Comments should start with a space.'
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#hash-space'
Enabled: true
Layout/MultilineArrayBraceLayout:
Description: >-
Checks that the closing brace in an array literal is
either on the same line as the last array element, or
a new line.
Enabled: true
Style/MultilineBlockChain:
Description: 'Avoid multi-line chains of blocks.'
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#single-line-blocks'
Enabled: true
Layout/MultilineBlockLayout:
Description: 'Ensures newlines after multiline block do statements.'
Enabled: true
Layout/MultilineHashBraceLayout:
Description: >-
Checks that the closing brace in a hash literal is
either on the same line as the last hash element, or
a new line.
Enabled: true
Style/MultilineIfThen:
Description: 'Do not use then for multi-line if/unless.'
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#no-then'
Enabled: true
Style/NegatedIf:
Description: >-
Favor unless over if for negative conditions
(or control flow or).
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#unless-for-negatives'
Enabled: true
Style/NegatedWhile:
Description: 'Favor until over while for negative conditions.'
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#until-for-negatives'
Enabled: true
Style/NestedTernaryOperator:
Description: 'Use one expression per branch in a ternary operator.'
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#no-nested-ternary'
Enabled: true
Style/NilComparison:
Description: 'Prefer x.nil? to x == nil.'
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#predicate-methods'
Enabled: true
Style/NonNilCheck:
Description: 'Checks for redundant nil checks.'
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#no-non-nil-checks'
Enabled: true
Style/NumericLiterals:
Description: >-
Add underscores to large numeric literals to improve their
readability.
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#underscores-in-numerics'
Enabled: true
Style/NumericLiteralPrefix:
Description: 'Use smallcase prefixes for numeric literals.'
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#numeric-literal-prefixes'
Enabled: true
Naming/PredicateName:
Description: 'Check the names of predicate methods.'
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#bool-methods-qmark'
Enabled: true
Style/RedundantSelf:
Description: "Don't use self where it's not needed."
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#no-self-unless-required'
Enabled: true
Style/SelfAssignment:
Enabled: true
Layout/SpaceBeforeComment:
Description: >-
Checks for missing space between code and a comment on the
same line.
Enabled: true
Layout/SpaceAroundOperators:
Description: 'Use a single space around operators.'
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#spaces-operators'
Enabled: true
Layout/SpaceAroundOperators:
Description: 'Use a single space around operators.'
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#spaces-operators'
Enabled: true
Layout/SpaceInsideArrayPercentLiteral:
Description: 'No unnecessary additional spaces between elements in %i/%w literals.'
Enabled: true
Layout/SpaceInsidePercentLiteralDelimiters:
Description: 'No unnecessary spaces inside delimiters of %i/%w/%x literals.'
Enabled: true
Style/SymbolLiteral:
Description: 'Use plain symbols instead of string symbols when possible.'
Enabled: true
Layout/Tab:
Description: 'No hard tabs.'
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#spaces-indentation'
Enabled: true
Layout/TrailingWhitespace:
Description: 'Avoid trailing whitespace.'
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#no-trailing-whitespace'
Enabled: true
Style/UnlessElse:
Description: >-
Do not use unless with else. Rewrite these with the positive
case first.
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#no-else-with-unless'
Enabled: true
Style/WhenThen:
Description: 'Use when x then ... for one-line cases.'
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#one-line-cases'
Enabled: true
Style/WordArray:
Description: 'Use %w or %W for arrays of words.'
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#percent-w'
Enabled: true
Lint/AssignmentInCondition:
Description: "Don't use assignment in conditions."
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#safe-assignment-in-condition'
Enabled: true
Lint/DefEndAlignment:
Description: 'Align ends corresponding to defs correctly.'
Enabled: true
Lint/DuplicateMethods:
Description: 'Check for duplicate method definitions.'
Enabled: true
Lint/DuplicatedKey:
Description: 'Check for duplicate keys in hash literals.'
Enabled: true
Lint/ElseLayout:
Description: 'Check for odd code arrangement in an else block.'
Enabled: true
Lint/ImplicitStringConcatenation:
Description: >-
Checks for adjacent string literals on the same line, which
could better be represented as a single string literal.
Enabled: true
Lint/PercentStringArray:
Description: >-
Checks for unwanted commas and quotes in %w/%W literals.
Enabled: true
Lint/ShadowedException:
Description: >-
Avoid rescuing a higher level exception
before a lower level exception.
Enabled: true
Lint/UnusedMethodArgument:
Description: 'Checks for unused method arguments.'
StyleGuide: 'https://github.com/bbatsov/ruby-Layout-guide#underscore-unused-vars'
Enabled: true
Lint/UnreachableCode:
Description: 'Unreachable code.'
Enabled: true