lendesk-ruby-lint-config 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.ruby-style.yml +1094 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +33 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lendesk-ruby-lint-config.gemspec +30 -0
- data/lib/lendesk_ruby_lint_config.rb +5 -0
- data/lib/lendesk_ruby_lint_config/version.rb +3 -0
- metadata +70 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d75381e76f6ca9e58dd28cc7c723692eed2d0fd7
|
4
|
+
data.tar.gz: d76894c53d92bf73fa820c5899271b64bf5e6588
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 817e69aa39624c3b18e65a6550e8ff6102df48f261fdf640b32fb8e5c7308910125ddfcf18b317f98a48aa026728e36bc6e895c88161cd279bc567e13b329256
|
7
|
+
data.tar.gz: e2904c7f094217795de668b0493e3264e16e0efdabdfea608e0234356dc86fc4e00574f703140b0dd4da8076b82a5d3123cc56dc3298e02446775d82f4f53053
|
data/.gitignore
ADDED
data/.ruby-style.yml
ADDED
@@ -0,0 +1,1094 @@
|
|
1
|
+
AllCops:
|
2
|
+
Include:
|
3
|
+
- "**/*.gemspec"
|
4
|
+
- "**/*.podspec"
|
5
|
+
- "**/*.jbuilder"
|
6
|
+
- "**/*.rake"
|
7
|
+
- "**/*.opal"
|
8
|
+
- "**/Gemfile"
|
9
|
+
- "**/Rakefile"
|
10
|
+
- "**/Capfile"
|
11
|
+
- "**/Guardfile"
|
12
|
+
- "**/Podfile"
|
13
|
+
- "**/Thorfile"
|
14
|
+
- "**/Vagrantfile"
|
15
|
+
- "**/Berksfile"
|
16
|
+
- "**/Cheffile"
|
17
|
+
- "**/Vagabondfile"
|
18
|
+
Exclude:
|
19
|
+
- "vendor/**/*"
|
20
|
+
- "db/schema.rb"
|
21
|
+
DisplayCopNames: true
|
22
|
+
StyleGuideCopsOnly: false
|
23
|
+
Style/AccessModifierIndentation:
|
24
|
+
Description: Check indentation of private/protected visibility modifiers.
|
25
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected
|
26
|
+
Enabled: true
|
27
|
+
EnforcedStyle: indent
|
28
|
+
SupportedStyles:
|
29
|
+
- outdent
|
30
|
+
- indent
|
31
|
+
Style/AlignHash:
|
32
|
+
Description: Align the elements of a hash literal if they span more than one line.
|
33
|
+
Enabled: true
|
34
|
+
EnforcedHashRocketStyle: key
|
35
|
+
EnforcedColonStyle: key
|
36
|
+
EnforcedLastArgumentHashStyle: always_inspect
|
37
|
+
SupportedLastArgumentHashStyles:
|
38
|
+
- always_inspect
|
39
|
+
- always_ignore
|
40
|
+
- ignore_implicit
|
41
|
+
- ignore_explicit
|
42
|
+
Style/AlignParameters:
|
43
|
+
Description: Align the parameters of a method call if they span more than one line.
|
44
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-double-indent
|
45
|
+
Enabled: true
|
46
|
+
EnforcedStyle: with_first_parameter
|
47
|
+
SupportedStyles:
|
48
|
+
- with_first_parameter
|
49
|
+
- with_fixed_indentation
|
50
|
+
Style/AndOr:
|
51
|
+
Description: Use &&/|| instead of and/or.
|
52
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-and-or-or
|
53
|
+
Enabled: true
|
54
|
+
EnforcedStyle: always
|
55
|
+
SupportedStyles:
|
56
|
+
- always
|
57
|
+
- conditionals
|
58
|
+
Style/BarePercentLiterals:
|
59
|
+
Description: Checks if usage of %() or %Q() matches configuration.
|
60
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand
|
61
|
+
Enabled: true
|
62
|
+
EnforcedStyle: bare_percent
|
63
|
+
SupportedStyles:
|
64
|
+
- percent_q
|
65
|
+
- bare_percent
|
66
|
+
Style/BracesAroundHashParameters:
|
67
|
+
Description: Enforce braces style around hash parameters.
|
68
|
+
Enabled: true
|
69
|
+
EnforcedStyle: no_braces
|
70
|
+
SupportedStyles:
|
71
|
+
- braces
|
72
|
+
- no_braces
|
73
|
+
- context_dependent
|
74
|
+
Style/CaseIndentation:
|
75
|
+
Description: Indentation of when in a case/when/[else/]end.
|
76
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-when-to-case
|
77
|
+
Enabled: true
|
78
|
+
IndentWhenRelativeTo: case
|
79
|
+
SupportedStyles:
|
80
|
+
- case
|
81
|
+
- end
|
82
|
+
IndentOneStep: false
|
83
|
+
Style/ClassAndModuleChildren:
|
84
|
+
Description: Checks style of children classes and modules.
|
85
|
+
Enabled: false
|
86
|
+
EnforcedStyle: nested
|
87
|
+
SupportedStyles:
|
88
|
+
- nested
|
89
|
+
- compact
|
90
|
+
Style/ClassCheck:
|
91
|
+
Description: Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.
|
92
|
+
Enabled: true
|
93
|
+
EnforcedStyle: is_a?
|
94
|
+
SupportedStyles:
|
95
|
+
- is_a?
|
96
|
+
- kind_of?
|
97
|
+
Style/CollectionMethods:
|
98
|
+
Description: Preferred collection methods.
|
99
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
|
100
|
+
Enabled: false
|
101
|
+
PreferredMethods:
|
102
|
+
collect: map
|
103
|
+
collect!: map!
|
104
|
+
find: detect
|
105
|
+
find_all: select
|
106
|
+
reduce: inject
|
107
|
+
Style/CommentAnnotation:
|
108
|
+
Description: Checks formatting of special comments (TODO, FIXME, OPTIMIZE, HACK,
|
109
|
+
REVIEW).
|
110
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#annotate-keywords
|
111
|
+
Enabled: true
|
112
|
+
Keywords:
|
113
|
+
- TODO
|
114
|
+
- FIXME
|
115
|
+
- OPTIMIZE
|
116
|
+
- HACK
|
117
|
+
- REVIEW
|
118
|
+
Style/DotPosition:
|
119
|
+
Description: Checks the position of the dot in multi-line method calls.
|
120
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
|
121
|
+
Enabled: true
|
122
|
+
EnforcedStyle: leading
|
123
|
+
SupportedStyles:
|
124
|
+
- leading
|
125
|
+
- trailing
|
126
|
+
Style/EmptyLineBetweenDefs:
|
127
|
+
Description: Use empty lines between defs.
|
128
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods
|
129
|
+
Enabled: true
|
130
|
+
AllowAdjacentOneLineDefs: false
|
131
|
+
Style/EmptyLinesAroundBlockBody:
|
132
|
+
Description: Keeps track of empty lines around block bodies.
|
133
|
+
Enabled: true
|
134
|
+
EnforcedStyle: no_empty_lines
|
135
|
+
SupportedStyles:
|
136
|
+
- empty_lines
|
137
|
+
- no_empty_lines
|
138
|
+
Style/EmptyLinesAroundClassBody:
|
139
|
+
Description: Keeps track of empty lines around class bodies.
|
140
|
+
Enabled: true
|
141
|
+
EnforcedStyle: no_empty_lines
|
142
|
+
SupportedStyles:
|
143
|
+
- empty_lines
|
144
|
+
- no_empty_lines
|
145
|
+
Style/EmptyLinesAroundModuleBody:
|
146
|
+
Description: Keeps track of empty lines around module bodies.
|
147
|
+
Enabled: true
|
148
|
+
EnforcedStyle: no_empty_lines
|
149
|
+
SupportedStyles:
|
150
|
+
- empty_lines
|
151
|
+
- no_empty_lines
|
152
|
+
Style/Encoding:
|
153
|
+
Description: Use UTF-8 as the source file encoding.
|
154
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#utf-8
|
155
|
+
Enabled: false
|
156
|
+
EnforcedStyle: always
|
157
|
+
SupportedStyles:
|
158
|
+
- when_needed
|
159
|
+
- always
|
160
|
+
Style/FileName:
|
161
|
+
Description: Use snake_case for source file names.
|
162
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
|
163
|
+
Enabled: false
|
164
|
+
Exclude: []
|
165
|
+
Style/FirstParameterIndentation:
|
166
|
+
Description: Checks the indentation of the first parameter in a method call.
|
167
|
+
Enabled: true
|
168
|
+
EnforcedStyle: special_for_inner_method_call_in_parentheses
|
169
|
+
SupportedStyles:
|
170
|
+
- consistent
|
171
|
+
- special_for_inner_method_call
|
172
|
+
- special_for_inner_method_call_in_parentheses
|
173
|
+
Style/For:
|
174
|
+
Description: Checks use of for or each in multiline loops.
|
175
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-for-loops
|
176
|
+
Enabled: true
|
177
|
+
EnforcedStyle: each
|
178
|
+
SupportedStyles:
|
179
|
+
- for
|
180
|
+
- each
|
181
|
+
Style/FormatString:
|
182
|
+
Description: Enforce the use of Kernel#sprintf, Kernel#format or String#%.
|
183
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#sprintf
|
184
|
+
Enabled: false
|
185
|
+
EnforcedStyle: format
|
186
|
+
SupportedStyles:
|
187
|
+
- format
|
188
|
+
- sprintf
|
189
|
+
- percent
|
190
|
+
Style/FrozenStringLiteralComment:
|
191
|
+
EnforcedStyle: when_needed
|
192
|
+
SupportedStyles:
|
193
|
+
# `when_needed` will add the frozen string literal comment to files
|
194
|
+
# only when the `TargetRubyVersion` is set to 2.3+.
|
195
|
+
- when_needed
|
196
|
+
# `always` will always add the frozen string literal comment to a file
|
197
|
+
# regardless of the Ruby version or if `freeze` or `<<` are called on a
|
198
|
+
# string literal. If you run code against multiple versions of Ruby, it is
|
199
|
+
# possible that this will create errors in Ruby 2.3.0+.
|
200
|
+
- always
|
201
|
+
Style/GlobalVars:
|
202
|
+
Description: Do not introduce global variables.
|
203
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#instance-vars
|
204
|
+
Enabled: false
|
205
|
+
AllowedVariables: []
|
206
|
+
Style/GuardClause:
|
207
|
+
Description: Check for conditionals that can be replaced with guard clauses
|
208
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
|
209
|
+
Enabled: false
|
210
|
+
MinBodyLength: 1
|
211
|
+
Style/HashSyntax:
|
212
|
+
Description: 'Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax { :a =>
|
213
|
+
1, :b => 2 }.'
|
214
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-literals
|
215
|
+
Enabled: true
|
216
|
+
EnforcedStyle: ruby19
|
217
|
+
SupportedStyles:
|
218
|
+
- ruby19
|
219
|
+
- hash_rockets
|
220
|
+
Style/IfUnlessModifier:
|
221
|
+
Description: Favor modifier if/unless usage when you have a single-line body.
|
222
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
|
223
|
+
Enabled: true
|
224
|
+
MaxLineLength: 70
|
225
|
+
Style/IndentationWidth:
|
226
|
+
Description: Use 2 spaces for indentation.
|
227
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
|
228
|
+
Enabled: true
|
229
|
+
Width: 2
|
230
|
+
Style/IndentHash:
|
231
|
+
Description: Checks the indentation of the first key in a hash literal.
|
232
|
+
Enabled: true
|
233
|
+
EnforcedStyle: special_inside_parentheses
|
234
|
+
SupportedStyles:
|
235
|
+
- special_inside_parentheses
|
236
|
+
- consistent
|
237
|
+
Style/LambdaCall:
|
238
|
+
Description: Use lambda.call(...) instead of lambda.(...).
|
239
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc-call
|
240
|
+
Enabled: false
|
241
|
+
EnforcedStyle: call
|
242
|
+
SupportedStyles:
|
243
|
+
- call
|
244
|
+
- braces
|
245
|
+
Style/Next:
|
246
|
+
Description: Use `next` to skip iteration instead of a condition at the end.
|
247
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
|
248
|
+
Enabled: false
|
249
|
+
EnforcedStyle: skip_modifier_ifs
|
250
|
+
MinBodyLength: 3
|
251
|
+
SupportedStyles:
|
252
|
+
- skip_modifier_ifs
|
253
|
+
- always
|
254
|
+
Style/NonNilCheck:
|
255
|
+
Description: Checks for redundant nil checks.
|
256
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks
|
257
|
+
Enabled: true
|
258
|
+
IncludeSemanticChanges: false
|
259
|
+
Style/MethodDefParentheses:
|
260
|
+
Description: Checks if the method definitions have or don't have parentheses.
|
261
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens
|
262
|
+
Enabled: true
|
263
|
+
EnforcedStyle: require_parentheses
|
264
|
+
SupportedStyles:
|
265
|
+
- require_parentheses
|
266
|
+
- require_no_parentheses
|
267
|
+
Style/MethodName:
|
268
|
+
Description: Use the configured style when naming methods.
|
269
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
|
270
|
+
Enabled: true
|
271
|
+
EnforcedStyle: snake_case
|
272
|
+
SupportedStyles:
|
273
|
+
- snake_case
|
274
|
+
- camelCase
|
275
|
+
Style/MultilineOperationIndentation:
|
276
|
+
Description: Checks indentation of binary operations that span more than one line.
|
277
|
+
Enabled: true
|
278
|
+
EnforcedStyle: aligned
|
279
|
+
SupportedStyles:
|
280
|
+
- aligned
|
281
|
+
- indented
|
282
|
+
Style/NumericLiterals:
|
283
|
+
Description: Add underscores to large numeric literals to improve their readability.
|
284
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics
|
285
|
+
Enabled: true
|
286
|
+
MinDigits: 5
|
287
|
+
Style/ParallelAssignment:
|
288
|
+
Description: >-
|
289
|
+
Check for simple usages of parallel assignment.
|
290
|
+
It will only warn when the number of variables
|
291
|
+
matches on both sides of the assignment.
|
292
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parallel-assignment'
|
293
|
+
Enabled: false
|
294
|
+
Style/ParenthesesAroundCondition:
|
295
|
+
Description: Don't use parentheses around the condition of an if/unless/while.
|
296
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-parens-if
|
297
|
+
Enabled: true
|
298
|
+
AllowSafeAssignment: true
|
299
|
+
Style/PercentLiteralDelimiters:
|
300
|
+
Description: Use `%`-literal delimiters consistently
|
301
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
|
302
|
+
Enabled: false
|
303
|
+
PreferredDelimiters:
|
304
|
+
"%": "()"
|
305
|
+
"%i": "()"
|
306
|
+
"%q": "()"
|
307
|
+
"%Q": "()"
|
308
|
+
"%r": "{}"
|
309
|
+
"%s": "()"
|
310
|
+
"%w": "()"
|
311
|
+
"%W": "()"
|
312
|
+
"%x": "()"
|
313
|
+
Style/PercentQLiterals:
|
314
|
+
Description: Checks if uses of %Q/%q match the configured preference.
|
315
|
+
Enabled: true
|
316
|
+
EnforcedStyle: lower_case_q
|
317
|
+
SupportedStyles:
|
318
|
+
- lower_case_q
|
319
|
+
- upper_case_q
|
320
|
+
Style/PredicateName:
|
321
|
+
Description: Check the names of predicate methods.
|
322
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
|
323
|
+
Enabled: true
|
324
|
+
Exclude:
|
325
|
+
- !ruby/regexp '/app\/serializers\/.*[.]{1}rb/i'
|
326
|
+
NamePrefix:
|
327
|
+
- is_
|
328
|
+
- has_
|
329
|
+
- have_
|
330
|
+
NamePrefixBlacklist:
|
331
|
+
- is_
|
332
|
+
Style/RaiseArgs:
|
333
|
+
Description: Checks the arguments passed to raise/fail.
|
334
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
|
335
|
+
Enabled: false
|
336
|
+
EnforcedStyle: exploded
|
337
|
+
SupportedStyles:
|
338
|
+
- compact
|
339
|
+
- exploded
|
340
|
+
Style/RedundantReturn:
|
341
|
+
Description: Don't use return where it's not required.
|
342
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-explicit-return
|
343
|
+
Enabled: true
|
344
|
+
AllowMultipleReturnValues: false
|
345
|
+
Style/Semicolon:
|
346
|
+
Description: Don't use semicolons to terminate expressions.
|
347
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon
|
348
|
+
Enabled: true
|
349
|
+
AllowAsExpressionSeparator: false
|
350
|
+
Style/SignalException:
|
351
|
+
Description: Checks for proper usage of fail and raise.
|
352
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
|
353
|
+
Enabled: true
|
354
|
+
EnforcedStyle: semantic
|
355
|
+
SupportedStyles:
|
356
|
+
- only_raise
|
357
|
+
- only_fail
|
358
|
+
- semantic
|
359
|
+
Style/SingleLineBlockParams:
|
360
|
+
Description: Enforces the names of some block params.
|
361
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
|
362
|
+
Enabled: false
|
363
|
+
Methods:
|
364
|
+
- reduce:
|
365
|
+
- a
|
366
|
+
- e
|
367
|
+
- inject:
|
368
|
+
- a
|
369
|
+
- e
|
370
|
+
Style/SingleLineMethods:
|
371
|
+
Description: Avoid single-line methods.
|
372
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
|
373
|
+
Enabled: true
|
374
|
+
AllowIfMethodIsEmpty: false
|
375
|
+
Style/StringLiterals:
|
376
|
+
Description: Checks if uses of quotes match the configured preference.
|
377
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
|
378
|
+
Enabled: true
|
379
|
+
EnforcedStyle: single_quotes
|
380
|
+
SupportedStyles:
|
381
|
+
- single_quotes
|
382
|
+
- double_quotes
|
383
|
+
Style/StringLiteralsInInterpolation:
|
384
|
+
Description: Checks if uses of quotes inside expressions in interpolated strings
|
385
|
+
match the configured preference.
|
386
|
+
Enabled: true
|
387
|
+
EnforcedStyle: single_quotes
|
388
|
+
SupportedStyles:
|
389
|
+
- single_quotes
|
390
|
+
- double_quotes
|
391
|
+
Style/SpaceAroundBlockParameters:
|
392
|
+
Description: Checks the spacing inside and after block parameters pipes.
|
393
|
+
Enabled: true
|
394
|
+
EnforcedStyleInsidePipes: no_space
|
395
|
+
SupportedStyles:
|
396
|
+
- space
|
397
|
+
- no_space
|
398
|
+
Style/SpaceAroundEqualsInParameterDefault:
|
399
|
+
Description: Checks that the equals signs in parameter default assignments have
|
400
|
+
or don't have surrounding space depending on configuration.
|
401
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-around-equals
|
402
|
+
Enabled: true
|
403
|
+
EnforcedStyle: space
|
404
|
+
SupportedStyles:
|
405
|
+
- space
|
406
|
+
- no_space
|
407
|
+
Style/SpaceBeforeBlockBraces:
|
408
|
+
Description: Checks that the left block brace has or doesn't have space before it.
|
409
|
+
Enabled: true
|
410
|
+
EnforcedStyle: space
|
411
|
+
SupportedStyles:
|
412
|
+
- space
|
413
|
+
- no_space
|
414
|
+
Style/SpaceInsideBlockBraces:
|
415
|
+
Description: Checks that block braces have or don't have surrounding space. For
|
416
|
+
blocks taking parameters, checks that the left brace has or doesn't have trailing
|
417
|
+
space.
|
418
|
+
Enabled: true
|
419
|
+
EnforcedStyle: space
|
420
|
+
SupportedStyles:
|
421
|
+
- space
|
422
|
+
- no_space
|
423
|
+
EnforcedStyleForEmptyBraces: no_space
|
424
|
+
SpaceBeforeBlockParameters: true
|
425
|
+
Style/SpaceInsideHashLiteralBraces:
|
426
|
+
Description: Use spaces inside hash literal braces - or don't.
|
427
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
428
|
+
Enabled: true
|
429
|
+
EnforcedStyle: space
|
430
|
+
EnforcedStyleForEmptyBraces: no_space
|
431
|
+
SupportedStyles:
|
432
|
+
- space
|
433
|
+
- no_space
|
434
|
+
Style/SymbolProc:
|
435
|
+
Description: Use symbols as procs instead of blocks when possible.
|
436
|
+
Enabled: true
|
437
|
+
IgnoredMethods:
|
438
|
+
- respond_to
|
439
|
+
Style/TrailingBlankLines:
|
440
|
+
Description: Checks trailing blank lines and final newline.
|
441
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#newline-eof
|
442
|
+
Enabled: true
|
443
|
+
EnforcedStyle: final_newline
|
444
|
+
SupportedStyles:
|
445
|
+
- final_newline
|
446
|
+
- final_blank_line
|
447
|
+
Style/TrailingCommaInLiteral:
|
448
|
+
Description: Checks for trailing comma in parameter lists and literals.
|
449
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
|
450
|
+
Enabled: true
|
451
|
+
EnforcedStyleForMultiline: no_comma
|
452
|
+
SupportedStyles:
|
453
|
+
- comma
|
454
|
+
- no_comma
|
455
|
+
Style/TrivialAccessors:
|
456
|
+
Description: Prefer attr_* methods to trivial readers/writers.
|
457
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr_family
|
458
|
+
Enabled: true
|
459
|
+
ExactNameMatch: true
|
460
|
+
AllowPredicates: false
|
461
|
+
AllowDSLWriters: false
|
462
|
+
Whitelist:
|
463
|
+
- to_ary
|
464
|
+
- to_a
|
465
|
+
- to_c
|
466
|
+
- to_enum
|
467
|
+
- to_h
|
468
|
+
- to_hash
|
469
|
+
- to_i
|
470
|
+
- to_int
|
471
|
+
- to_io
|
472
|
+
- to_open
|
473
|
+
- to_path
|
474
|
+
- to_proc
|
475
|
+
- to_r
|
476
|
+
- to_regexp
|
477
|
+
- to_str
|
478
|
+
- to_s
|
479
|
+
- to_sym
|
480
|
+
Style/VariableName:
|
481
|
+
Description: Use the configured style when naming variables.
|
482
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
|
483
|
+
Enabled: true
|
484
|
+
EnforcedStyle: snake_case
|
485
|
+
SupportedStyles:
|
486
|
+
- snake_case
|
487
|
+
- camelCase
|
488
|
+
Style/WhileUntilModifier:
|
489
|
+
Description: Favor modifier while/until usage when you have a single-line body.
|
490
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier
|
491
|
+
Enabled: true
|
492
|
+
MaxLineLength: 70
|
493
|
+
Style/WordArray:
|
494
|
+
Description: Use %w or %W for arrays of words.
|
495
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-w
|
496
|
+
Enabled: false
|
497
|
+
MinSize: 0
|
498
|
+
WordRegex: !ruby/regexp /\A[\p{Word}]+\z/
|
499
|
+
Metrics/AbcSize:
|
500
|
+
Description: A calculated magnitude based on number of assignments, branches, and
|
501
|
+
conditions.
|
502
|
+
Enabled: false
|
503
|
+
Max: 15
|
504
|
+
Metrics/BlockNesting:
|
505
|
+
Description: Avoid excessive block nesting
|
506
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count
|
507
|
+
Enabled: true
|
508
|
+
Max: 3
|
509
|
+
Metrics/ClassLength:
|
510
|
+
Description: Avoid classes longer than 100 lines of code.
|
511
|
+
Enabled: false
|
512
|
+
CountComments: false
|
513
|
+
Max: 100
|
514
|
+
Metrics/CyclomaticComplexity:
|
515
|
+
Description: A complexity metric that is strongly correlated to the number of test
|
516
|
+
cases needed to validate a method.
|
517
|
+
Enabled: false
|
518
|
+
Max: 6
|
519
|
+
Metrics/LineLength:
|
520
|
+
Description: Limit lines to 80 characters.
|
521
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#80-character-limits
|
522
|
+
Enabled: true
|
523
|
+
Max: 120
|
524
|
+
AllowURI: true
|
525
|
+
URISchemes:
|
526
|
+
- http
|
527
|
+
- https
|
528
|
+
Metrics/MethodLength:
|
529
|
+
Description: Avoid methods longer than 10 lines of code.
|
530
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
|
531
|
+
Enabled: false
|
532
|
+
CountComments: true
|
533
|
+
Max: 10
|
534
|
+
Metrics/ParameterLists:
|
535
|
+
Description: Avoid parameter lists longer than three or four parameters.
|
536
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
|
537
|
+
Enabled: true
|
538
|
+
Max: 4
|
539
|
+
CountKeywordArgs: false
|
540
|
+
Metrics/PerceivedComplexity:
|
541
|
+
Description: A complexity metric geared towards measuring complexity for a human
|
542
|
+
reader.
|
543
|
+
Enabled: false
|
544
|
+
Max: 7
|
545
|
+
Lint/AssignmentInCondition:
|
546
|
+
Description: Don't use assignment in conditions.
|
547
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
|
548
|
+
Enabled: true
|
549
|
+
AllowSafeAssignment: true
|
550
|
+
Lint/EndAlignment:
|
551
|
+
Description: Align ends correctly.
|
552
|
+
Enabled: true
|
553
|
+
AlignWith: keyword
|
554
|
+
SupportedStyles:
|
555
|
+
- keyword
|
556
|
+
- variable
|
557
|
+
Lint/DefEndAlignment:
|
558
|
+
Description: Align ends corresponding to defs correctly.
|
559
|
+
Enabled: true
|
560
|
+
AlignWith: start_of_line
|
561
|
+
SupportedStyles:
|
562
|
+
- start_of_line
|
563
|
+
- def
|
564
|
+
Rails/ActionFilter:
|
565
|
+
Description: Enforces consistent use of action filter methods.
|
566
|
+
Enabled: true
|
567
|
+
EnforcedStyle: action
|
568
|
+
SupportedStyles:
|
569
|
+
- action
|
570
|
+
- filter
|
571
|
+
Include:
|
572
|
+
- app/controllers/**/*.rb
|
573
|
+
Rails/HasAndBelongsToMany:
|
574
|
+
Description: Prefer has_many :through to has_and_belongs_to_many.
|
575
|
+
Enabled: true
|
576
|
+
Include:
|
577
|
+
- app/models/**/*.rb
|
578
|
+
Rails/Output:
|
579
|
+
Description: Checks for calls to puts, print, etc.
|
580
|
+
Enabled: true
|
581
|
+
Include:
|
582
|
+
- app/**/*.rb
|
583
|
+
- config/**/*.rb
|
584
|
+
- db/**/*.rb
|
585
|
+
- lib/**/*.rb
|
586
|
+
Rails/ReadWriteAttribute:
|
587
|
+
Description: Checks for read_attribute(:attr) and write_attribute(:attr, val).
|
588
|
+
Enabled: true
|
589
|
+
Include:
|
590
|
+
- app/models/**/*.rb
|
591
|
+
Rails/ScopeArgs:
|
592
|
+
Description: Checks the arguments of ActiveRecord scopes.
|
593
|
+
Enabled: true
|
594
|
+
Include:
|
595
|
+
- app/models/**/*.rb
|
596
|
+
Rails/Validation:
|
597
|
+
Description: Use validates :attribute, hash of validations.
|
598
|
+
Enabled: false
|
599
|
+
Include:
|
600
|
+
- app/models/**/*.rb
|
601
|
+
Style/InlineComment:
|
602
|
+
Description: Avoid inline comments.
|
603
|
+
Enabled: false
|
604
|
+
Style/MethodCalledOnDoEndBlock:
|
605
|
+
Description: Avoid chaining a method call on a do...end block.
|
606
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
|
607
|
+
Enabled: true
|
608
|
+
Style/SymbolArray:
|
609
|
+
Description: Use %i or %I for arrays of symbols.
|
610
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-i
|
611
|
+
Enabled: false
|
612
|
+
Style/ExtraSpacing:
|
613
|
+
Description: Do not use unnecessary spacing.
|
614
|
+
Enabled: true
|
615
|
+
Style/AccessorMethodName:
|
616
|
+
Description: Check the naming of accessor methods for get_/set_.
|
617
|
+
Enabled: true
|
618
|
+
Style/Alias:
|
619
|
+
Description: Use alias_method instead of alias.
|
620
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
|
621
|
+
Enabled: true
|
622
|
+
EnforcedStyle: prefer_alias_method
|
623
|
+
SupportedStyles:
|
624
|
+
- prefer_alias
|
625
|
+
- prefer_alias_method
|
626
|
+
Style/AlignArray:
|
627
|
+
Description: Align the elements of an array literal if they span more than one line.
|
628
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays
|
629
|
+
Enabled: true
|
630
|
+
Style/ArrayJoin:
|
631
|
+
Description: Use Array#join instead of Array#*.
|
632
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#array-join
|
633
|
+
Enabled: true
|
634
|
+
Style/AsciiComments:
|
635
|
+
Description: Use only ascii symbols in comments.
|
636
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-comments
|
637
|
+
Enabled: false
|
638
|
+
Style/AsciiIdentifiers:
|
639
|
+
Description: Use only ascii symbols in identifiers.
|
640
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-identifiers
|
641
|
+
Enabled: false
|
642
|
+
Style/Attr:
|
643
|
+
Description: Checks for uses of Module#attr.
|
644
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr
|
645
|
+
Enabled: true
|
646
|
+
Style/BeginBlock:
|
647
|
+
Description: Avoid the use of BEGIN blocks.
|
648
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks
|
649
|
+
Enabled: true
|
650
|
+
Style/BlockComments:
|
651
|
+
Description: Do not use block comments.
|
652
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-block-comments
|
653
|
+
Enabled: true
|
654
|
+
Style/BlockEndNewline:
|
655
|
+
Description: Put end statement of multiline block on its own line.
|
656
|
+
Enabled: true
|
657
|
+
Style/BlockDelimiters:
|
658
|
+
Description: Avoid using {...} for multi-line blocks (multiline chaining is always
|
659
|
+
ugly). Prefer {...} over do...end for single-line blocks.
|
660
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
|
661
|
+
Enabled: true
|
662
|
+
Style/CaseEquality:
|
663
|
+
Description: Avoid explicit use of the case equality operator(===).
|
664
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-case-equality
|
665
|
+
Enabled: true
|
666
|
+
Style/CharacterLiteral:
|
667
|
+
Description: Checks for uses of character literals.
|
668
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-character-literals
|
669
|
+
Enabled: true
|
670
|
+
Style/ClassAndModuleCamelCase:
|
671
|
+
Description: Use CamelCase for classes and modules.
|
672
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#camelcase-classes
|
673
|
+
Enabled: true
|
674
|
+
Style/ClassMethods:
|
675
|
+
Description: Use self when defining module/class methods.
|
676
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#def-self-singletons
|
677
|
+
Enabled: true
|
678
|
+
Style/ClassVars:
|
679
|
+
Description: Avoid the use of class variables.
|
680
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-class-vars
|
681
|
+
Enabled: false
|
682
|
+
Style/ColonMethodCall:
|
683
|
+
Description: 'Do not use :: for method call.'
|
684
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#double-colons
|
685
|
+
Enabled: true
|
686
|
+
Style/CommentIndentation:
|
687
|
+
Description: Indentation of comments.
|
688
|
+
Enabled: true
|
689
|
+
Style/ConstantName:
|
690
|
+
Description: Constants should use SCREAMING_SNAKE_CASE.
|
691
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#screaming-snake-case
|
692
|
+
Enabled: true
|
693
|
+
Style/DefWithParentheses:
|
694
|
+
Description: Use def with parentheses when there are arguments.
|
695
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens
|
696
|
+
Enabled: true
|
697
|
+
Style/HashSyntax:
|
698
|
+
EnforcedStyle: ruby19
|
699
|
+
SupportedStyles:
|
700
|
+
# checks for 1.9 syntax (e.g. {a: 1}) for all symbol keys
|
701
|
+
- ruby19
|
702
|
+
# checks for hash rocket syntax for all hashes
|
703
|
+
- hash_rockets
|
704
|
+
# forbids mixed key syntaxes (e.g. {a: 1, :b => 2})
|
705
|
+
- no_mixed_keys
|
706
|
+
# enforces both ruby19 and no_mixed_keys styles
|
707
|
+
- ruby19_no_mixed_keys
|
708
|
+
# Force hashes that have a symbol value to use hash rockets
|
709
|
+
UseHashRocketsWithSymbolValues: false
|
710
|
+
# Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
|
711
|
+
PreferHashRocketsForNonAlnumEndingSymbols: false
|
712
|
+
Description: Checks for use of deprecated Hash methods.
|
713
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-key
|
714
|
+
Enabled: true
|
715
|
+
Style/Documentation:
|
716
|
+
Description: Document classes and non-namespace modules.
|
717
|
+
Enabled: false
|
718
|
+
Style/DoubleNegation:
|
719
|
+
Description: Checks for uses of double negation (!!).
|
720
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
|
721
|
+
Enabled: true
|
722
|
+
Style/EachWithObject:
|
723
|
+
Description: Prefer `each_with_object` over `inject` or `reduce`.
|
724
|
+
Enabled: false
|
725
|
+
Style/ElseAlignment:
|
726
|
+
Description: Align elses and elsifs correctly.
|
727
|
+
Enabled: true
|
728
|
+
Style/EmptyElse:
|
729
|
+
Description: Avoid empty else-clauses.
|
730
|
+
Enabled: true
|
731
|
+
Style/EmptyLines:
|
732
|
+
Description: Don't use several empty lines in a row.
|
733
|
+
Enabled: true
|
734
|
+
Style/EmptyLinesAroundAccessModifier:
|
735
|
+
Description: Keep blank lines around access modifiers.
|
736
|
+
Enabled: true
|
737
|
+
Style/EmptyLinesAroundMethodBody:
|
738
|
+
Description: Keeps track of empty lines around method bodies.
|
739
|
+
Enabled: true
|
740
|
+
Style/EmptyLiteral:
|
741
|
+
Description: Prefer literals to Array.new/Hash.new/String.new.
|
742
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
|
743
|
+
Enabled: true
|
744
|
+
Style/EndBlock:
|
745
|
+
Description: Avoid the use of END blocks.
|
746
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-END-blocks
|
747
|
+
Enabled: true
|
748
|
+
Style/EndOfLine:
|
749
|
+
Description: Use Unix-style line endings.
|
750
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#crlf
|
751
|
+
Enabled: true
|
752
|
+
Style/EvenOdd:
|
753
|
+
Description: Favor the use of Fixnum#even? && Fixnum#odd?
|
754
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
|
755
|
+
Enabled: true
|
756
|
+
Style/FlipFlop:
|
757
|
+
Description: Checks for flip flops
|
758
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-flip-flops
|
759
|
+
Enabled: true
|
760
|
+
Style/IfWithSemicolon:
|
761
|
+
Description: Do not use if x; .... Use the ternary operator instead.
|
762
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs
|
763
|
+
Enabled: true
|
764
|
+
Style/IndentationConsistency:
|
765
|
+
Description: Keep indentation straight.
|
766
|
+
Enabled: true
|
767
|
+
Style/IndentArray:
|
768
|
+
Description: Checks the indentation of the first element in an array literal.
|
769
|
+
Enabled: true
|
770
|
+
Style/InfiniteLoop:
|
771
|
+
Description: Use Kernel#loop for infinite loops.
|
772
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#infinite-loop
|
773
|
+
Enabled: true
|
774
|
+
Style/Lambda:
|
775
|
+
Description: Use the new lambda literal syntax for single-line blocks.
|
776
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#lambda-multi-line
|
777
|
+
Enabled: false
|
778
|
+
EnforcedStyle: line_count_dependent
|
779
|
+
SupportedStyles:
|
780
|
+
- line_count_dependent
|
781
|
+
- lambda
|
782
|
+
- literal
|
783
|
+
Style/LeadingCommentSpace:
|
784
|
+
Description: Comments should start with a space.
|
785
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-space
|
786
|
+
Enabled: true
|
787
|
+
Style/LineEndConcatenation:
|
788
|
+
Description: Use \ instead of + or << to concatenate two string literals at line
|
789
|
+
end.
|
790
|
+
Enabled: true
|
791
|
+
Style/MethodCallParentheses:
|
792
|
+
Description: Do not use parentheses for method calls with no arguments.
|
793
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-args-no-parens
|
794
|
+
Enabled: true
|
795
|
+
Style/ModuleFunction:
|
796
|
+
Description: Checks for usage of `extend self` in modules.
|
797
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
|
798
|
+
Enabled: false
|
799
|
+
Style/MultilineBlockChain:
|
800
|
+
Description: Avoid multi-line chains of blocks.
|
801
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
|
802
|
+
Enabled: true
|
803
|
+
Style/MultilineBlockLayout:
|
804
|
+
Description: Ensures newlines after multiline block do statements.
|
805
|
+
Enabled: true
|
806
|
+
Style/MultilineIfThen:
|
807
|
+
Description: Do not use then for multi-line if/unless.
|
808
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-then
|
809
|
+
Enabled: true
|
810
|
+
Style/MultilineTernaryOperator:
|
811
|
+
Description: 'Avoid multi-line ?: (the ternary operator); use if/unless instead.'
|
812
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary
|
813
|
+
Enabled: true
|
814
|
+
Style/NegatedIf:
|
815
|
+
Description: Favor unless over if for negative conditions (or control flow or).
|
816
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#unless-for-negatives
|
817
|
+
Enabled: false
|
818
|
+
Style/NegatedWhile:
|
819
|
+
Description: Favor until over while for negative conditions.
|
820
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#until-for-negatives
|
821
|
+
Enabled: true
|
822
|
+
Style/NestedTernaryOperator:
|
823
|
+
Description: Use one expression per branch in a ternary operator.
|
824
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-ternary
|
825
|
+
Enabled: true
|
826
|
+
Style/NilComparison:
|
827
|
+
Description: Prefer x.nil? to x == nil.
|
828
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
|
829
|
+
Enabled: true
|
830
|
+
Style/Not:
|
831
|
+
Description: Use ! instead of not.
|
832
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bang-not-not
|
833
|
+
Enabled: true
|
834
|
+
Style/OneLineConditional:
|
835
|
+
Description: Favor the ternary operator(?:) over if/then/else/end constructs.
|
836
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
|
837
|
+
Enabled: true
|
838
|
+
Style/OpMethod:
|
839
|
+
Description: When defining binary operators, name the argument other.
|
840
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#other-arg
|
841
|
+
Enabled: false
|
842
|
+
Style/PerlBackrefs:
|
843
|
+
Description: Avoid Perl-style regex back references.
|
844
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
|
845
|
+
Enabled: false
|
846
|
+
Style/Proc:
|
847
|
+
Description: Use proc instead of Proc.new.
|
848
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc
|
849
|
+
Enabled: true
|
850
|
+
Style/RedundantBegin:
|
851
|
+
Description: Don't use begin blocks when they are not needed.
|
852
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#begin-implicit
|
853
|
+
Enabled: true
|
854
|
+
Style/RedundantException:
|
855
|
+
Description: Checks for an obsolete RuntimeException argument in raise/fail.
|
856
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror
|
857
|
+
Enabled: true
|
858
|
+
Style/RedundantSelf:
|
859
|
+
Description: Don't use self where it's not needed.
|
860
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-self-unless-required
|
861
|
+
Enabled: true
|
862
|
+
Style/RescueModifier:
|
863
|
+
Description: Avoid using rescue in its modifier form.
|
864
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers
|
865
|
+
Enabled: true
|
866
|
+
Style/SafeNavigation:
|
867
|
+
Enabled: false
|
868
|
+
Style/SelfAssignment:
|
869
|
+
Description: Checks for places where self-assignment shorthand should have been
|
870
|
+
used.
|
871
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#self-assignment
|
872
|
+
Enabled: true
|
873
|
+
Style/SpaceBeforeFirstArg:
|
874
|
+
Description: Checks that exactly one space is used between a method name and the
|
875
|
+
first argument for method calls without parentheses.
|
876
|
+
Enabled: true
|
877
|
+
Style/SpaceAfterColon:
|
878
|
+
Description: Use spaces after colons.
|
879
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
880
|
+
Enabled: true
|
881
|
+
Style/SpaceAfterComma:
|
882
|
+
Description: Use spaces after commas.
|
883
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
884
|
+
Enabled: true
|
885
|
+
Style/SpaceAroundKeyword:
|
886
|
+
Description: Use spaces after if/elsif/unless/while/until/case/when.
|
887
|
+
Enabled: true
|
888
|
+
Style/SpaceAfterMethodName:
|
889
|
+
Description: Do not put a space between a method name and the opening parenthesis
|
890
|
+
in a method definition.
|
891
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
|
892
|
+
Enabled: true
|
893
|
+
Style/SpaceAfterNot:
|
894
|
+
Description: Tracks redundant space after the ! operator.
|
895
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-bang
|
896
|
+
Enabled: true
|
897
|
+
Style/SpaceAfterSemicolon:
|
898
|
+
Description: Use spaces after semicolons.
|
899
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
900
|
+
Enabled: true
|
901
|
+
Style/SpaceBeforeComma:
|
902
|
+
Description: No spaces before commas.
|
903
|
+
Enabled: true
|
904
|
+
Style/SpaceBeforeComment:
|
905
|
+
Description: Checks for missing space between code and a comment on the same line.
|
906
|
+
Enabled: true
|
907
|
+
Style/SpaceBeforeSemicolon:
|
908
|
+
Description: No spaces before semicolons.
|
909
|
+
Enabled: true
|
910
|
+
Style/SpaceAroundOperators:
|
911
|
+
Description: Use spaces around operators.
|
912
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
913
|
+
Enabled: true
|
914
|
+
Style/SpaceAroundKeyword:
|
915
|
+
Description: Put a space before the modifier keyword.
|
916
|
+
Enabled: true
|
917
|
+
Style/SpaceInsideBrackets:
|
918
|
+
Description: No spaces after [ or before ].
|
919
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
|
920
|
+
Enabled: true
|
921
|
+
Style/SpaceInsideParens:
|
922
|
+
Description: No spaces after ( or before ).
|
923
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
|
924
|
+
Enabled: true
|
925
|
+
Style/SpaceInsideRangeLiteral:
|
926
|
+
Description: No spaces inside range literals.
|
927
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals
|
928
|
+
Enabled: true
|
929
|
+
Style/SpecialGlobalVars:
|
930
|
+
Description: Avoid Perl-style global variables.
|
931
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
|
932
|
+
Enabled: false
|
933
|
+
Style/StructInheritance:
|
934
|
+
Description: Checks for inheritance from Struct.new.
|
935
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new
|
936
|
+
Enabled: true
|
937
|
+
Style/Tab:
|
938
|
+
Description: No hard tabs.
|
939
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
|
940
|
+
Enabled: true
|
941
|
+
Style/TrailingWhitespace:
|
942
|
+
Description: Avoid trailing whitespace.
|
943
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace
|
944
|
+
Enabled: true
|
945
|
+
Style/UnlessElse:
|
946
|
+
Description: Do not use unless with else. Rewrite these with the positive case first.
|
947
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-else-with-unless
|
948
|
+
Enabled: true
|
949
|
+
Style/UnneededCapitalW:
|
950
|
+
Description: Checks for %W when interpolation is not needed.
|
951
|
+
Enabled: true
|
952
|
+
Style/UnneededPercentQ:
|
953
|
+
Description: Checks for %q/%Q when single quotes or double quotes would do.
|
954
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q
|
955
|
+
Enabled: true
|
956
|
+
Style/VariableInterpolation:
|
957
|
+
Description: Don't interpolate global, instance and class variables directly in
|
958
|
+
strings.
|
959
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
|
960
|
+
Enabled: true
|
961
|
+
Style/WhenThen:
|
962
|
+
Description: Use when x then ... for one-line cases.
|
963
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
|
964
|
+
Enabled: true
|
965
|
+
Style/WhileUntilDo:
|
966
|
+
Description: Checks for redundant do after while or until.
|
967
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do
|
968
|
+
Enabled: true
|
969
|
+
Lint/AmbiguousOperator:
|
970
|
+
Description: Checks for ambiguous operators in the first argument of a method invocation
|
971
|
+
without parentheses.
|
972
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-as-args
|
973
|
+
Enabled: true
|
974
|
+
Lint/AmbiguousRegexpLiteral:
|
975
|
+
Description: Checks for ambiguous regexp literals in the first argument of a method
|
976
|
+
invocation without parenthesis.
|
977
|
+
Enabled: true
|
978
|
+
Lint/BlockAlignment:
|
979
|
+
Description: Align block ends correctly.
|
980
|
+
Enabled: true
|
981
|
+
Lint/ConditionPosition:
|
982
|
+
Description: Checks for condition placed in a confusing position relative to the
|
983
|
+
keyword.
|
984
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#same-line-condition
|
985
|
+
Enabled: true
|
986
|
+
Lint/Debugger:
|
987
|
+
Description: Check for debugger calls.
|
988
|
+
Enabled: true
|
989
|
+
Lint/DeprecatedClassMethods:
|
990
|
+
Description: Check for deprecated class method calls.
|
991
|
+
Enabled: true
|
992
|
+
Lint/DuplicateMethods:
|
993
|
+
Description: Check for duplicate methods calls.
|
994
|
+
Enabled: true
|
995
|
+
Lint/ElseLayout:
|
996
|
+
Description: Check for odd code arrangement in an else block.
|
997
|
+
Enabled: true
|
998
|
+
Lint/EmptyEnsure:
|
999
|
+
Description: Checks for empty ensure block.
|
1000
|
+
Enabled: true
|
1001
|
+
Lint/EmptyInterpolation:
|
1002
|
+
Description: Checks for empty string interpolation.
|
1003
|
+
Enabled: true
|
1004
|
+
Lint/EndInMethod:
|
1005
|
+
Description: END blocks should not be placed inside method definitions.
|
1006
|
+
Enabled: true
|
1007
|
+
Lint/EnsureReturn:
|
1008
|
+
Description: Do not use return in an ensure block.
|
1009
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-return-ensure
|
1010
|
+
Enabled: true
|
1011
|
+
Lint/Eval:
|
1012
|
+
Description: The use of eval represents a serious security risk.
|
1013
|
+
Enabled: true
|
1014
|
+
Lint/HandleExceptions:
|
1015
|
+
Description: Don't suppress exception.
|
1016
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
|
1017
|
+
Enabled: true
|
1018
|
+
Lint/InvalidCharacterLiteral:
|
1019
|
+
Description: Checks for invalid character literals with a non-escaped whitespace
|
1020
|
+
character.
|
1021
|
+
Enabled: true
|
1022
|
+
Lint/LiteralInCondition:
|
1023
|
+
Description: Checks of literals used in conditions.
|
1024
|
+
Enabled: true
|
1025
|
+
Lint/LiteralInInterpolation:
|
1026
|
+
Description: Checks for literals used in interpolation.
|
1027
|
+
Enabled: true
|
1028
|
+
Lint/Loop:
|
1029
|
+
Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while
|
1030
|
+
for post-loop tests.
|
1031
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#loop-with-break
|
1032
|
+
Enabled: true
|
1033
|
+
Lint/ParenthesesAsGroupedExpression:
|
1034
|
+
Description: Checks for method calls with a space before the opening parenthesis.
|
1035
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
|
1036
|
+
Enabled: true
|
1037
|
+
Lint/RequireParentheses:
|
1038
|
+
Description: Use parentheses in the method call to avoid confusion about precedence.
|
1039
|
+
Enabled: true
|
1040
|
+
Lint/RescueException:
|
1041
|
+
Description: Avoid rescuing the Exception class.
|
1042
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-blind-rescues
|
1043
|
+
Enabled: true
|
1044
|
+
Lint/ShadowingOuterLocalVariable:
|
1045
|
+
Description: Do not use the same name as outer local variable for block arguments
|
1046
|
+
or block local variables.
|
1047
|
+
Enabled: true
|
1048
|
+
Style/SpaceBeforeFirstArg:
|
1049
|
+
Description: Put a space between a method name and the first argument in a method
|
1050
|
+
call without parentheses.
|
1051
|
+
Enabled: true
|
1052
|
+
Lint/StringConversionInInterpolation:
|
1053
|
+
Description: Checks for Object#to_s usage in string interpolation.
|
1054
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-to-s
|
1055
|
+
Enabled: true
|
1056
|
+
Lint/UnderscorePrefixedVariableName:
|
1057
|
+
Description: Do not use prefix `_` for a variable that is used.
|
1058
|
+
Enabled: true
|
1059
|
+
Lint/UnusedBlockArgument:
|
1060
|
+
Description: Checks for unused block arguments.
|
1061
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
|
1062
|
+
Enabled: true
|
1063
|
+
Lint/UnusedMethodArgument:
|
1064
|
+
Description: Checks for unused method arguments.
|
1065
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
|
1066
|
+
Enabled: true
|
1067
|
+
Lint/UnreachableCode:
|
1068
|
+
Description: Unreachable code.
|
1069
|
+
Enabled: true
|
1070
|
+
Lint/UselessAccessModifier:
|
1071
|
+
Description: Checks for useless access modifiers.
|
1072
|
+
Enabled: true
|
1073
|
+
Lint/UselessAssignment:
|
1074
|
+
Description: Checks for useless assignment to a local variable.
|
1075
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
|
1076
|
+
Enabled: true
|
1077
|
+
Lint/UselessComparison:
|
1078
|
+
Description: Checks for comparison of something with itself.
|
1079
|
+
Enabled: true
|
1080
|
+
Lint/UselessElseWithoutRescue:
|
1081
|
+
Description: Checks for useless `else` in `begin..end` without `rescue`.
|
1082
|
+
Enabled: true
|
1083
|
+
Lint/UselessSetterCall:
|
1084
|
+
Description: Checks for useless setter call to a local variable.
|
1085
|
+
Enabled: true
|
1086
|
+
Lint/Void:
|
1087
|
+
Description: Possible use of operator/literal/variable in void context.
|
1088
|
+
Enabled: false
|
1089
|
+
Rails/Delegate:
|
1090
|
+
Description: Prefer delegate method for delegations.
|
1091
|
+
Enabled: false
|
1092
|
+
Performance/RedundantMatch:
|
1093
|
+
Description: Use =~ in places where the MatchData returned by match will not be used.
|
1094
|
+
Enabled: true
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
+
threatening, offensive, or harmful.
|
28
|
+
|
29
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
+
fairly and consistently applying these principles to every aspect of managing
|
31
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
+
Conduct may be permanently removed from the project team.
|
33
|
+
|
34
|
+
This code of conduct applies both within project spaces and in public spaces
|
35
|
+
when an individual is representing the project or its community.
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
+
reported by contacting a project maintainer at geoff.lee@lendesk.com. All
|
39
|
+
complaints will be reviewed and investigated and will result in a response that
|
40
|
+
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
+
incident.
|
43
|
+
|
44
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
+
version 1.3.0, available at
|
46
|
+
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
+
|
48
|
+
[homepage]: http://contributor-covenant.org
|
49
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 matrinox
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# Lendesk::Ruby::Lint::Config
|
2
|
+
|
3
|
+
You can either install this gem or pull from the URL
|
4
|
+
|
5
|
+
## Gem
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'lendesk-ruby-lint-config'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install lendesk-ruby-lint-config
|
20
|
+
|
21
|
+
In your ruby-style.yml:
|
22
|
+
```yaml
|
23
|
+
inherit_from:
|
24
|
+
lendesk-ruby-lint-config: .ruby-style.yml
|
25
|
+
```
|
26
|
+
|
27
|
+
## URL
|
28
|
+
|
29
|
+
In your ruby-style.yml:
|
30
|
+
```yaml
|
31
|
+
inherit_from:
|
32
|
+
- https://github.com/matrinox/lendesk-ruby-lint-config/blob/master/.ruby-style.yml
|
33
|
+
```
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "lendesk/ruby/lint/config"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'lendesk_ruby_lint_config/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'lendesk-ruby-lint-config'
|
8
|
+
spec.version = LendeskRubyLintConfig::VERSION
|
9
|
+
spec.authors = ['matrinox']
|
10
|
+
spec.email = ['geoff.lee@lendesk.com']
|
11
|
+
|
12
|
+
spec.summary = 'Shared ruby lint config for lendesk'
|
13
|
+
spec.description = 'Shared ruby lint config for lendesk'
|
14
|
+
spec.homepage = 'https://github.com/matrinox/lendesk-ruby-lint-config'
|
15
|
+
|
16
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
17
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
18
|
+
if spec.respond_to?(:metadata)
|
19
|
+
spec.metadata['allowed_push_host'] = "https://rubygems.org"
|
20
|
+
else
|
21
|
+
raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
|
22
|
+
end
|
23
|
+
|
24
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
|
+
spec.bindir = 'exe'
|
26
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
|
+
spec.require_paths = ['lib']
|
28
|
+
|
29
|
+
spec.add_development_dependency 'bundler', '~> 1.12'
|
30
|
+
end
|
metadata
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: lendesk-ruby-lint-config
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- matrinox
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-10-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.12'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.12'
|
27
|
+
description: Shared ruby lint config for lendesk
|
28
|
+
email:
|
29
|
+
- geoff.lee@lendesk.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- ".gitignore"
|
35
|
+
- ".ruby-style.yml"
|
36
|
+
- CODE_OF_CONDUCT.md
|
37
|
+
- Gemfile
|
38
|
+
- LICENSE.txt
|
39
|
+
- README.md
|
40
|
+
- bin/console
|
41
|
+
- bin/setup
|
42
|
+
- lendesk-ruby-lint-config.gemspec
|
43
|
+
- lib/lendesk_ruby_lint_config.rb
|
44
|
+
- lib/lendesk_ruby_lint_config/version.rb
|
45
|
+
homepage: https://github.com/matrinox/lendesk-ruby-lint-config
|
46
|
+
licenses: []
|
47
|
+
metadata:
|
48
|
+
allowed_push_host: https://rubygems.org
|
49
|
+
post_install_message:
|
50
|
+
rdoc_options: []
|
51
|
+
require_paths:
|
52
|
+
- lib
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
58
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
requirements: []
|
64
|
+
rubyforge_project:
|
65
|
+
rubygems_version: 2.4.5
|
66
|
+
signing_key:
|
67
|
+
specification_version: 4
|
68
|
+
summary: Shared ruby lint config for lendesk
|
69
|
+
test_files: []
|
70
|
+
has_rdoc:
|