lcgstyle 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,370 @@
1
+ #
2
+ # Lint
3
+ #
4
+
5
+ Lint/AmbiguousOperator:
6
+ Enabled: true
7
+ Lint/BlockAlignment:
8
+ Enabled: true
9
+ Lint/CircularArgumentReference:
10
+ Enabled: true
11
+ Lint/ConditionPosition:
12
+ Enabled: true
13
+ Lint/Debugger:
14
+ Enabled: true
15
+ Lint/DefEndAlignment:
16
+ Enabled: true
17
+ Lint/DuplicateMethods:
18
+ Enabled: true
19
+ Lint/DuplicatedKey:
20
+ Enabled: true
21
+ Lint/EachWithObjectArgument:
22
+ Enabled: true
23
+ Lint/ElseLayout:
24
+ Enabled: true
25
+ Lint/EmptyEnsure:
26
+ Enabled: true
27
+ Lint/EmptyInterpolation:
28
+ Enabled: true
29
+ Lint/EndAlignment:
30
+ Enabled: true
31
+ Lint/EndInMethod:
32
+ Enabled: true
33
+ Lint/EnsureReturn:
34
+ Enabled: true
35
+ Lint/FormatParameterMismatch:
36
+ Enabled: true
37
+ Lint/InvalidCharacterLiteral:
38
+ Enabled: true
39
+ Lint/LiteralInCondition:
40
+ Enabled: true
41
+ Lint/LiteralInInterpolation:
42
+ Enabled: true
43
+ Lint/Loop:
44
+ Enabled: true
45
+ Lint/NonLocalExitFromIterator:
46
+ Enabled: true
47
+ Lint/RequireParentheses:
48
+ Enabled: true
49
+ Lint/StringConversionInInterpolation:
50
+ Enabled: true
51
+ Lint/UnneededDisable:
52
+ Enabled: true
53
+ Lint/UnreachableCode:
54
+ Enabled: true
55
+ Lint/UselessComparison:
56
+ Enabled: true
57
+ Lint/UselessElseWithoutRescue:
58
+ Enabled: true
59
+ Lint/UselessSetterCall:
60
+ Enabled: true
61
+
62
+ #
63
+ # Disabled Lint
64
+ #
65
+
66
+ # These are disabled per https://github.com/chef/chef/pull/3038
67
+ Lint/UnusedBlockArgument:
68
+ Enabled: false
69
+ Lint/UnusedMethodArgument:
70
+ Enabled: false
71
+
72
+ # We ignore Exceptions a lot
73
+ Lint/HandleExceptions:
74
+ Enabled: false
75
+ # We also decorate Exceptions a lot
76
+ Lint/RescueException:
77
+ Enabled: false
78
+
79
+ #
80
+ # Performance
81
+ #
82
+
83
+ Performance/Casecmp:
84
+ Enabled: true
85
+ Performance/CaseWhenSplat:
86
+ Enabled: true
87
+ Performance/Detect:
88
+ Enabled: true
89
+ Performance/FixedSize:
90
+ Enabled: true
91
+ Performance/FlatMap:
92
+ Enabled: true
93
+ Performance/RangeInclude:
94
+ Enabled: true
95
+ Performance/RedundantBlockCall:
96
+ Enabled: true
97
+ Performance/RedundantMatch:
98
+ Enabled: true
99
+ Performance/RedundantMerge:
100
+ Enabled: true
101
+ Performance/ReverseEach:
102
+ Enabled: true
103
+ Performance/Sample:
104
+ Enabled: true
105
+ Performance/Size:
106
+ Enabled: true
107
+ Performance/StringReplacement:
108
+ Enabled: true
109
+
110
+ #
111
+ # Rails
112
+ #
113
+
114
+ Rails/ActionFilter:
115
+ Enabled: true
116
+ Rails/Date:
117
+ Enabled: true
118
+ Rails/Delegate:
119
+ Enabled: true
120
+ Rails/FindBy:
121
+ Enabled: true
122
+ Rails/FindEach:
123
+ Enabled: true
124
+ Rails/HasAndBelongsToMany:
125
+ Enabled: true
126
+ Rails/Output:
127
+ Enabled: true
128
+ Rails/PluralizationGrammar:
129
+ Enabled: true
130
+ Rails/ReadWriteAttribute:
131
+ Enabled: true
132
+ Rails/ScopeArgs:
133
+ Enabled: true
134
+ Rails/TimeZone:
135
+ Enabled: true
136
+ Rails/Validation:
137
+ Enabled: true
138
+
139
+ #
140
+ # Metrics
141
+ #
142
+
143
+ # Metrics cops are all disabled, there would be too much refactoring
144
+ # work to do and we have much higher priorities.
145
+ Metrics/AbcSize:
146
+ Enabled: false
147
+ Metrics/BlockNesting:
148
+ Enabled: false
149
+ Metrics/ClassLength:
150
+ Enabled: false
151
+ Metrics/CyclomaticComplexity:
152
+ Enabled: false
153
+ Metrics/LineLength:
154
+ Enabled: false
155
+ Metrics/MethodLength:
156
+ Enabled: false
157
+ Metrics/ModuleLength:
158
+ Enabled: false
159
+ Metrics/ParameterLists:
160
+ Enabled: false
161
+ Metrics/PerceivedComplexity:
162
+ Enabled: false
163
+
164
+
165
+ #
166
+ # Style
167
+ #
168
+
169
+ Style/AlignHash:
170
+ Enabled: true
171
+ Style/AndOr:
172
+ Enabled: true
173
+ Style/ArrayJoin:
174
+ Enabled: true
175
+ Style/AsciiIdentifiers:
176
+ Enabled: true
177
+ Style/Attr:
178
+ Enabled: true
179
+ Style/BeginBlock:
180
+ Enabled: true
181
+ Style/CharacterLiteral:
182
+ Enabled: true
183
+ Style/ClassMethods:
184
+ Enabled: true
185
+ Style/ColonMethodCall:
186
+ Enabled: true
187
+ Style/CommandLiteral:
188
+ Enabled: true
189
+ Style/ElseAlignment:
190
+ Enabled: true
191
+ Style/EmptyLineBetweenDefs:
192
+ Enabled: true
193
+ Style/EmptyLines:
194
+ Enabled: true
195
+ Style/EmptyLinesAroundAccessModifier:
196
+ Enabled: true
197
+ Style/EmptyLinesAroundMethodBody:
198
+ Enabled: true
199
+ Style/EndBlock:
200
+ Enabled: true
201
+ Style/EndOfLine:
202
+ Enabled: true
203
+ Style/EvenOdd:
204
+ Enabled: true
205
+ Style/ExtraSpacing:
206
+ Enabled: true
207
+ Style/FlipFlop:
208
+ Enabled: true
209
+ Style/For:
210
+ Enabled: true
211
+ Style/IfWithSemicolon:
212
+ Enabled: true
213
+ Style/IndentationConsistency:
214
+ Enabled: true
215
+ Style/IndentationWidth:
216
+ Enabled: true
217
+ Style/InfiniteLoop:
218
+ Enabled: true
219
+ Style/InitialIndentation:
220
+ Enabled: true
221
+ Style/LambdaCall:
222
+ Enabled: true
223
+ Style/MethodDefParentheses:
224
+ Enabled: true
225
+ Style/MultilineOperationIndentation:
226
+ Enabled: true
227
+ EnforcedStyle: indented
228
+ Style/NegatedWhile:
229
+ Enabled: true
230
+ Style/NestedModifier:
231
+ Enabled: true
232
+ Style/NestedTernaryOperator:
233
+ Enabled: true
234
+ Style/OneLineConditional:
235
+ Enabled: true
236
+ Style/ParenthesesAroundCondition:
237
+ Enabled: true
238
+ # - The chef source code predominantly uses {} for %,%i,%q,%Q,%r,%w,%W
239
+ # - The old 1.9 pickaxe book predominantly uses {} for %,%q,%Q,%r,%w,%W,%x
240
+ # - The chef source code does not use %x enough to determine a preference
241
+ # - The old 1.9 pickaxe book does not use %i
242
+ # - %s is not used in chef code or the pickaxe book, and is %s{} for consistency
243
+ Style/PercentLiteralDelimiters:
244
+ Enabled: true
245
+ PreferredDelimiters:
246
+ '%': '{}'
247
+ '%i': '{}'
248
+ '%q': '{}'
249
+ '%Q': '{}'
250
+ '%r': '{}'
251
+ '%s': '{}'
252
+ '%w': '{}'
253
+ '%W': '{}'
254
+ '%x': '{}'
255
+ Style/PercentQLiterals:
256
+ Enabled: true
257
+ Style/RedundantFreeze:
258
+ Enabled: true
259
+ Style/RescueEnsureAlignment:
260
+ Enabled: true
261
+ # we only 'raise' and do not 'fail'
262
+ Style/SignalException:
263
+ EnforcedStyle: only_raise
264
+ Enabled: true
265
+ Style/SpaceAfterColon:
266
+ Enabled: true
267
+ Style/SpaceAfterComma:
268
+ Enabled: true
269
+ Style/SpaceAfterMethodName:
270
+ Enabled: true
271
+ Style/SpaceAroundBlockParameters:
272
+ Enabled: true
273
+ Style/SpaceAroundEqualsInParameterDefault:
274
+ Enabled: true
275
+ Style/SpaceAroundOperators:
276
+ Enabled: true
277
+ Style/SpaceBeforeBlockBraces:
278
+ Enabled: true
279
+ Style/SpaceBeforeFirstArg:
280
+ Enabled: true
281
+ Style/SpaceAroundKeyword:
282
+ Enabled: true
283
+ Style/SpaceInsideBlockBraces:
284
+ Enabled: true
285
+ Style/SpaceInsideHashLiteralBraces:
286
+ Enabled: true
287
+ Style/SpaceInsideRangeLiteral:
288
+ Enabled: true
289
+ Style/StabbyLambdaParentheses:
290
+ Enabled: true
291
+ # core chef community prefers double quotes over single quotes
292
+ Style/StringLiterals:
293
+ EnforcedStyle: double_quotes
294
+ Enabled: true
295
+ Style/SymbolLiteral:
296
+ Enabled: true
297
+ Style/Tab:
298
+ Enabled: true
299
+ Style/TrailingBlankLines:
300
+ Enabled: true
301
+ Style/TrailingCommaInArguments:
302
+ Enabled: true
303
+ # rubocop's default gets this completely backwards
304
+ Style/TrailingCommaInLiteral:
305
+ Enabled: true
306
+ EnforcedStyleForMultiline: comma
307
+ Style/TrailingUnderscoreVariable:
308
+ Enabled: true
309
+ Style/TrailingWhitespace:
310
+ Enabled: true
311
+ Style/UnneededCapitalW:
312
+ Enabled: true
313
+ #Style/UnneededPercentQ: # would like to enable this one but its buggy as of 0.35.1
314
+ # Enabled: true
315
+ Style/WhenThen:
316
+ Enabled: true
317
+ Style/WhileUntilDo:
318
+ Enabled: true
319
+ Style/WordArray:
320
+ Enabled: true
321
+
322
+ #
323
+ # Disabled Style
324
+ #
325
+
326
+ # As of this commit we have 686 modules and classes without docs.
327
+ # This is a cop that we /should/ have enabled, but tactically we can't really enable.
328
+ Style/Documentation:
329
+ Enabled: false
330
+
331
+ # this makes whitespace formatting of DSL code impossible
332
+ Style/SpaceBeforeFirstArg:
333
+ Enabled: false
334
+
335
+ # whitespace in expressions is useful to enhance readability
336
+ Style/SpaceInsideBrackets:
337
+ Enabled: false
338
+ Style/SpaceInsideParens:
339
+ Enabled: false
340
+
341
+ # more whitespace cops that we allow since they can enhance readability
342
+ Style/EmptyLinesAroundBlockBody:
343
+ Enabled: false
344
+ Style/EmptyLinesAroundClassBody:
345
+ Enabled: false
346
+ Style/EmptyLinesAroundModuleBody:
347
+ Enabled: false
348
+
349
+ # double negation is perfectly idiomatic ruby
350
+ Style/DoubleNegation:
351
+ Enabled: false
352
+ # format strings are also perfectly idiomatic ruby
353
+ Style/FormatString:
354
+ Enabled: false
355
+ # single line if/unless blocks may read more naturally than modifiers
356
+ Style/IfUnlessModifier:
357
+ Enabled: false
358
+
359
+ # we are ruby > 2.0 only so can disable the Encoding cop
360
+ Style/Encoding:
361
+ Enabled: false
362
+
363
+ # Dan is -1 on this one: https://github.com/chef/chef/pull/4526#issuecomment-179950045
364
+ Style/IndentHash:
365
+ Enabled: false
366
+
367
+ # This is overly aggressive and autofix broke stuff, would need to exclude classes
368
+ # - https://github.com/chef/chef/pull/4541
369
+ Style/TrivialAccessors:
370
+ Enabled: false
@@ -0,0 +1,3 @@
1
+ inherit_from:
2
+ - upstream.yml
3
+ - chefstyle.yml