pdf_cover 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.rspec +1 -0
- data/.rubocop.yml +1416 -0
- data/.travis.yml +10 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +21 -0
- data/README.md +65 -0
- data/Rakefile +18 -0
- data/bin/console +14 -0
- data/bin/setup +12 -0
- data/lib/paperclip/pdf_cover.rb +31 -0
- data/lib/pdf_cover/converter.rb +86 -0
- data/lib/pdf_cover/version.rb +3 -0
- data/lib/pdf_cover.rb +97 -0
- data/pdf_cover.gemspec +43 -0
- metadata +259 -0
data/.rubocop.yml
ADDED
@@ -0,0 +1,1416 @@
|
|
1
|
+
# Common configuration.
|
2
|
+
AllCops:
|
3
|
+
# Include gemspec and Rakefile
|
4
|
+
Include:
|
5
|
+
- '**/*.gemspec'
|
6
|
+
- '**/*.jbuilder'
|
7
|
+
- '**/*.rake'
|
8
|
+
- '**/Gemfile'
|
9
|
+
- '**/Rakefile'
|
10
|
+
- '**/Capfile'
|
11
|
+
- '**/Guardfile'
|
12
|
+
Exclude:
|
13
|
+
- 'vendor/**/*'
|
14
|
+
- 'bin/*'
|
15
|
+
- 'db/schema.rb'
|
16
|
+
- 'db/migrate/*.rb'
|
17
|
+
- 'spec/dummy/**/*'
|
18
|
+
|
19
|
+
# By default, the rails cops are not run. Override in project or home
|
20
|
+
# directory .rubocop.yml files, or by giving the -R/--rails option.
|
21
|
+
Rails:
|
22
|
+
Enabled: true
|
23
|
+
|
24
|
+
# Indent private/protected/public as deep as method definitions
|
25
|
+
AccessModifierIndentation:
|
26
|
+
Description: Check indentation of private/protected visibility modifiers.
|
27
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected'
|
28
|
+
EnforcedStyle: indent
|
29
|
+
Enabled: true
|
30
|
+
SupportedStyles:
|
31
|
+
- outdent
|
32
|
+
- indent
|
33
|
+
|
34
|
+
# Align the elements of a hash literal if they span more than one line.
|
35
|
+
AlignHash:
|
36
|
+
Description: >-
|
37
|
+
Align the elements of a hash literal if they span more than
|
38
|
+
one line.
|
39
|
+
Enabled: true
|
40
|
+
# Alignment of entries using hash rocket as separator. Valid values are:
|
41
|
+
#
|
42
|
+
# key - left alignment of keys
|
43
|
+
# 'a' => 2
|
44
|
+
# 'bb' => 3
|
45
|
+
# separator - alignment of hash rockets, keys are right aligned
|
46
|
+
# 'a' => 2
|
47
|
+
# 'bb' => 3
|
48
|
+
# table - left alignment of keys, hash rockets, and values
|
49
|
+
# 'a' => 2
|
50
|
+
# 'bb' => 3
|
51
|
+
EnforcedHashRocketStyle: key
|
52
|
+
|
53
|
+
# Alignment of entries using colon as separator. Valid values are:
|
54
|
+
#
|
55
|
+
# key - left alignment of keys
|
56
|
+
# a: 0
|
57
|
+
# bb: 1
|
58
|
+
# separator - alignment of colons, keys are right aligned
|
59
|
+
# a: 0
|
60
|
+
# bb: 1
|
61
|
+
# table - left alignment of keys and values
|
62
|
+
# a: 0
|
63
|
+
# bb: 1
|
64
|
+
EnforcedColonStyle: key
|
65
|
+
|
66
|
+
# Select whether hashes that are the last argument in a method call should be
|
67
|
+
# inspected? Valid values are:
|
68
|
+
#
|
69
|
+
# always_inspect - Inspect both implicit and explicit hashes.
|
70
|
+
# Registers an offense for:
|
71
|
+
# function(a: 1,
|
72
|
+
# b: 2)
|
73
|
+
# Registers an offense for:
|
74
|
+
# function({a: 1,
|
75
|
+
# b: 2})
|
76
|
+
# always_ignore - Ignore both implicit and explicit hashes.
|
77
|
+
# Accepts:
|
78
|
+
# function(a: 1,
|
79
|
+
# b: 2)
|
80
|
+
# Accepts:
|
81
|
+
# function({a: 1,
|
82
|
+
# b: 2})
|
83
|
+
# ignore_implicit - Ignore only implicit hashes.
|
84
|
+
# Accepts:
|
85
|
+
# function(a: 1,
|
86
|
+
# b: 2)
|
87
|
+
# Registers an offense for:
|
88
|
+
# function({a: 1,
|
89
|
+
# b: 2})
|
90
|
+
# ignore_explicit - Ignore only explicit hashes.
|
91
|
+
# Accepts:
|
92
|
+
# function({a: 1,
|
93
|
+
# b: 2})
|
94
|
+
# Registers an offense for:
|
95
|
+
# function(a: 1,
|
96
|
+
# b: 2)
|
97
|
+
EnforcedLastArgumentHashStyle: always_inspect
|
98
|
+
SupportedLastArgumentHashStyles:
|
99
|
+
- always_inspect
|
100
|
+
- always_ignore
|
101
|
+
- ignore_implicit
|
102
|
+
- ignore_explicit
|
103
|
+
|
104
|
+
FirstParameterIndentation:
|
105
|
+
Enabled: false
|
106
|
+
|
107
|
+
AlignParameters:
|
108
|
+
Description: >-
|
109
|
+
Align the parameters of a method call if they span more
|
110
|
+
than one line.
|
111
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
|
112
|
+
Enabled: true
|
113
|
+
# Alignment of parameters in multi-line method calls.
|
114
|
+
#
|
115
|
+
# The `with_first_parameter` style aligns the following lines along the same
|
116
|
+
# column as the first parameter.
|
117
|
+
#
|
118
|
+
# method_call(a,
|
119
|
+
# b)
|
120
|
+
#
|
121
|
+
# The `with_fixed_indentation` style aligns the following lines with one
|
122
|
+
# level of indentation relative to the start of the line with the method call.
|
123
|
+
#
|
124
|
+
# method_call(a,
|
125
|
+
# b)
|
126
|
+
EnforcedStyle: with_fixed_indentation
|
127
|
+
SupportedStyles:
|
128
|
+
- with_first_parameter
|
129
|
+
- with_fixed_indentation
|
130
|
+
|
131
|
+
AndOr:
|
132
|
+
Description: 'Use &&/|| instead of and/or.'
|
133
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-and-or-or'
|
134
|
+
Enabled: true
|
135
|
+
# Whether `and` and `or` are banned only in conditionals (conditionals)
|
136
|
+
# or completely (always).
|
137
|
+
EnforcedStyle: always
|
138
|
+
SupportedStyles:
|
139
|
+
- always
|
140
|
+
- conditionals
|
141
|
+
|
142
|
+
# Checks if usage of %() or %Q() matches configuration.
|
143
|
+
BarePercentLiterals:
|
144
|
+
Description: 'Checks if usage of %() or %Q() matches configuration.'
|
145
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand'
|
146
|
+
Enabled: true
|
147
|
+
EnforcedStyle: bare_percent
|
148
|
+
SupportedStyles:
|
149
|
+
- percent_q
|
150
|
+
- bare_percent
|
151
|
+
|
152
|
+
BracesAroundHashParameters:
|
153
|
+
Description: 'Enforce braces style inside hash parameters.'
|
154
|
+
Enabled: false
|
155
|
+
EnforcedStyle: no_braces
|
156
|
+
SupportedStyles:
|
157
|
+
- braces
|
158
|
+
- no_braces
|
159
|
+
|
160
|
+
# Indentation of `when`.
|
161
|
+
CaseIndentation:
|
162
|
+
Description: 'Indentation of when in a case/when/[else/]end.'
|
163
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-when-to-case'
|
164
|
+
Enabled: true
|
165
|
+
IndentWhenRelativeTo: case
|
166
|
+
SupportedStyles:
|
167
|
+
- case
|
168
|
+
- end
|
169
|
+
IndentOneStep: true
|
170
|
+
|
171
|
+
ClassAndModuleChildren:
|
172
|
+
Description: 'Checks style of children classes and modules.'
|
173
|
+
Enabled: true
|
174
|
+
# Checks the style of children definitions at classes and modules.
|
175
|
+
#
|
176
|
+
# Basically there are two different styles:
|
177
|
+
#
|
178
|
+
# `nested` - have each child on a separate line
|
179
|
+
# class Foo
|
180
|
+
# class Bar
|
181
|
+
# end
|
182
|
+
# end
|
183
|
+
#
|
184
|
+
# `compact` - combine definitions as much as possible
|
185
|
+
# class Foo::Bar
|
186
|
+
# end
|
187
|
+
#
|
188
|
+
# The compact style is only forced, for classes / modules with one child.
|
189
|
+
EnforcedStyle: nested
|
190
|
+
SupportedStyles:
|
191
|
+
- nested
|
192
|
+
- compact
|
193
|
+
|
194
|
+
ClassCheck:
|
195
|
+
Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
|
196
|
+
EnforcedStyle: is_a?
|
197
|
+
Enabled: false
|
198
|
+
SupportedStyles:
|
199
|
+
- is_a?
|
200
|
+
- kind_of?
|
201
|
+
|
202
|
+
# Align with the style guide.
|
203
|
+
CollectionMethods:
|
204
|
+
Description: 'Preferred collection methods.'
|
205
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#map-fine-select-reduce-size'
|
206
|
+
Enabled: true
|
207
|
+
# Mapping from undesired method to desired_method
|
208
|
+
# e.g. to use `detect` over `find`:
|
209
|
+
#
|
210
|
+
# CollectionMethods:
|
211
|
+
# PreferredMethods:
|
212
|
+
# find: detect
|
213
|
+
PreferredMethods:
|
214
|
+
collect: 'map'
|
215
|
+
collect!: 'map!'
|
216
|
+
inject: 'reduce'
|
217
|
+
detect: 'find'
|
218
|
+
find_all: 'select'
|
219
|
+
|
220
|
+
# Checks formatting of special comments
|
221
|
+
CommentAnnotation:
|
222
|
+
Description: >-
|
223
|
+
Checks formatting of special comments
|
224
|
+
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
|
225
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
|
226
|
+
Enabled: false
|
227
|
+
Keywords:
|
228
|
+
- TODO
|
229
|
+
- FIXME
|
230
|
+
- OPTIMIZE
|
231
|
+
- HACK
|
232
|
+
- REVIEW
|
233
|
+
|
234
|
+
# Multi-line method chaining should be done with leading dots.
|
235
|
+
DotPosition:
|
236
|
+
Description: 'Checks the position of the dot in multi-line method calls.'
|
237
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
|
238
|
+
Enabled: true
|
239
|
+
EnforcedStyle: leading
|
240
|
+
SupportedStyles:
|
241
|
+
- leading
|
242
|
+
- trailing
|
243
|
+
|
244
|
+
# Use empty lines between defs.
|
245
|
+
EmptyLineBetweenDefs:
|
246
|
+
Description: 'Use empty lines between defs.'
|
247
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods'
|
248
|
+
Enabled: true
|
249
|
+
# If true, this parameter means that single line method definitions don't
|
250
|
+
# need an empty line between them.
|
251
|
+
AllowAdjacentOneLineDefs: false
|
252
|
+
|
253
|
+
# Checks whether the source file has a utf-8 encoding comment or not
|
254
|
+
Encoding:
|
255
|
+
Description: 'Use UTF-8 as the source file encoding.'
|
256
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#utf-8'
|
257
|
+
Enabled: false
|
258
|
+
EnforcedStyle: always
|
259
|
+
SupportedStyles:
|
260
|
+
- when_needed
|
261
|
+
- always
|
262
|
+
|
263
|
+
FileName:
|
264
|
+
Description: 'Use snake_case for source file names.'
|
265
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
|
266
|
+
Enabled: true
|
267
|
+
Exclude:
|
268
|
+
- '**/Rakefile'
|
269
|
+
- '**/Gemfile'
|
270
|
+
- '**/Capfile'
|
271
|
+
- '**/Guardfile'
|
272
|
+
|
273
|
+
# Checks use of for or each in multiline loops.
|
274
|
+
For:
|
275
|
+
Description: 'Checks use of for or each in multiline loops.'
|
276
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-for-loops'
|
277
|
+
Enabled: true
|
278
|
+
EnforcedStyle: each
|
279
|
+
SupportedStyles:
|
280
|
+
- for
|
281
|
+
- each
|
282
|
+
|
283
|
+
# Enforce the method used for string formatting.
|
284
|
+
FormatString:
|
285
|
+
Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
|
286
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
|
287
|
+
Enabled: true
|
288
|
+
EnforcedStyle: format
|
289
|
+
SupportedStyles:
|
290
|
+
- format
|
291
|
+
- sprintf
|
292
|
+
- percent
|
293
|
+
|
294
|
+
# Built-in global variables are allowed by default.
|
295
|
+
GlobalVars:
|
296
|
+
Description: 'Do not introduce global variables.'
|
297
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
|
298
|
+
Enabled: true
|
299
|
+
AllowedVariables: []
|
300
|
+
|
301
|
+
# `MinBodyLength` defines the number of lines of the a body of an if / unless
|
302
|
+
# needs to have to trigger this cop
|
303
|
+
GuardClause:
|
304
|
+
Description: 'Check for conditionals that can be replaced with guard clauses'
|
305
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
306
|
+
Enabled: true
|
307
|
+
MinBodyLength: 1
|
308
|
+
|
309
|
+
HashSyntax:
|
310
|
+
Description: >-
|
311
|
+
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
|
312
|
+
{ :a => 1, :b => 2 }.
|
313
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals'
|
314
|
+
Enabled: true
|
315
|
+
EnforcedStyle: ruby19
|
316
|
+
SupportedStyles:
|
317
|
+
- ruby19
|
318
|
+
- hash_rockets
|
319
|
+
|
320
|
+
IfUnlessModifier:
|
321
|
+
Description: >-
|
322
|
+
Favor modifier if/unless usage when you have a
|
323
|
+
single-line body.
|
324
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
|
325
|
+
Enabled: true
|
326
|
+
MaxLineLength: 100
|
327
|
+
|
328
|
+
# Checks the indentation of the first key in a hash literal.
|
329
|
+
IndentHash:
|
330
|
+
Description: 'Checks the indentation of the first key in a hash literal.'
|
331
|
+
# The value `special_inside_parentheses` means that hash literals with braces
|
332
|
+
# that have their opening brace on the same line as a surrounding opening
|
333
|
+
# round parenthesis, shall have their first key indented relative to the
|
334
|
+
# first position inside the parenthesis.
|
335
|
+
# The value `consistent` means that the indentation of the first key shall
|
336
|
+
# always be relative to the first position of the line where the opening
|
337
|
+
# brace is.
|
338
|
+
Enabled: false
|
339
|
+
EnforcedStyle: special_inside_parentheses
|
340
|
+
SupportedStyles:
|
341
|
+
- special_inside_parentheses
|
342
|
+
- consistent
|
343
|
+
|
344
|
+
LambdaCall:
|
345
|
+
Description: 'Use lambda.call(...) instead of lambda.(...).'
|
346
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
|
347
|
+
Enabled: true
|
348
|
+
EnforcedStyle: call
|
349
|
+
SupportedStyles:
|
350
|
+
- call
|
351
|
+
- braces
|
352
|
+
|
353
|
+
MethodDefParentheses:
|
354
|
+
Description: >-
|
355
|
+
Checks if the method definitions have or don't have
|
356
|
+
parentheses.
|
357
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
|
358
|
+
Enabled: true
|
359
|
+
EnforcedStyle: require_parentheses
|
360
|
+
SupportedStyles:
|
361
|
+
- require_parentheses
|
362
|
+
- require_no_parentheses
|
363
|
+
|
364
|
+
MethodName:
|
365
|
+
Description: 'Use the configured style when naming methods.'
|
366
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
|
367
|
+
Enabled: true
|
368
|
+
EnforcedStyle: snake_case
|
369
|
+
SupportedStyles:
|
370
|
+
- snake_case
|
371
|
+
- camelCase
|
372
|
+
|
373
|
+
Next:
|
374
|
+
Description: 'Use `next` to skip iteration instead of a condition at the end.'
|
375
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
376
|
+
Enabled: false
|
377
|
+
# With `always` all conditions at the end of an iteration needs to be
|
378
|
+
# replaced by next - with `skip_modifier_ifs` the modifier if like this one
|
379
|
+
# are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
|
380
|
+
#EnforcedStyle: skip_modifier_ifs
|
381
|
+
# `MinBodyLength` defines the number of lines of the a body of an if / unless
|
382
|
+
# needs to have to trigger this cop
|
383
|
+
MinBodyLength: 3
|
384
|
+
SupportedStyles:
|
385
|
+
- skip_modifier_ifs
|
386
|
+
- always
|
387
|
+
|
388
|
+
NonNilCheck:
|
389
|
+
Description: 'Checks for redundant nil checks.'
|
390
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks'
|
391
|
+
Enabled: false
|
392
|
+
# With `IncludeSemanticChanges` set to `true`, this cop reports offenses for
|
393
|
+
# `!x.nil?` and autocorrects that and `x != nil` to solely `x`, which is
|
394
|
+
# **usually** OK, but might change behavior.
|
395
|
+
#
|
396
|
+
# With `IncludeSemanticChanges` set to `false`, this cop does not report
|
397
|
+
# offenses for `!x.nil?` and does no changes that might change behavior.
|
398
|
+
IncludeSemanticChanges: false
|
399
|
+
|
400
|
+
NumericLiterals:
|
401
|
+
Description: >-
|
402
|
+
Add underscores to large numeric literals to improve their
|
403
|
+
readability.
|
404
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
|
405
|
+
Enabled: false
|
406
|
+
MinDigits: 5
|
407
|
+
|
408
|
+
# Allow safe assignment in conditions.
|
409
|
+
ParenthesesAroundCondition:
|
410
|
+
Description: >-
|
411
|
+
Don't use parentheses around the condition of an
|
412
|
+
if/unless/while.
|
413
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-parens-if'
|
414
|
+
Enabled: true
|
415
|
+
AllowSafeAssignment: true
|
416
|
+
|
417
|
+
PercentLiteralDelimiters:
|
418
|
+
Description: 'Use `%`-literal delimiters consistently'
|
419
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
|
420
|
+
Enabled: true
|
421
|
+
PreferredDelimiters:
|
422
|
+
'%': ()
|
423
|
+
'%i': ()
|
424
|
+
'%q': ()
|
425
|
+
'%Q': ()
|
426
|
+
'%r': '{}'
|
427
|
+
'%s': ()
|
428
|
+
'%w': ()
|
429
|
+
'%W': ()
|
430
|
+
'%x': ()
|
431
|
+
|
432
|
+
PercentQLiterals:
|
433
|
+
Description: 'Checks if uses of %Q/%q match the configured preference.'
|
434
|
+
Enabled: true
|
435
|
+
EnforcedStyle: lower_case_q
|
436
|
+
SupportedStyles:
|
437
|
+
- lower_case_q # Use %q when possible, %Q when necessary
|
438
|
+
- upper_case_q # Always use %Q
|
439
|
+
|
440
|
+
PredicateName:
|
441
|
+
Description: 'Check the names of predicate methods.'
|
442
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
|
443
|
+
Enabled: true
|
444
|
+
# Predicate name prefixes.
|
445
|
+
NamePrefix:
|
446
|
+
- has_
|
447
|
+
- have_
|
448
|
+
# Predicate name prefices that should be removed.
|
449
|
+
NamePrefixBlacklist:
|
450
|
+
- is_
|
451
|
+
|
452
|
+
RaiseArgs:
|
453
|
+
Description: 'Checks the arguments passed to raise/fail.'
|
454
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
|
455
|
+
Enabled: true
|
456
|
+
EnforcedStyle: exploded
|
457
|
+
SupportedStyles:
|
458
|
+
- compact # raise Exception.new(msg)
|
459
|
+
- exploded # raise Exception, msg
|
460
|
+
|
461
|
+
RedundantReturn:
|
462
|
+
Description: "Don't use return where it's not required."
|
463
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-return'
|
464
|
+
Enabled: true
|
465
|
+
# When true allows code like `return x, y`.
|
466
|
+
AllowMultipleReturnValues: false
|
467
|
+
|
468
|
+
RegexpLiteral:
|
469
|
+
Description: >-
|
470
|
+
Use %r for regular expressions matching more than
|
471
|
+
`MaxSlashes` '/' characters.
|
472
|
+
Use %r only for regular expressions matching more than
|
473
|
+
`MaxSlashes` '/' character.
|
474
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
|
475
|
+
Enabled: true
|
476
|
+
|
477
|
+
Semicolon:
|
478
|
+
Description: "Don't use semicolons to terminate expressions."
|
479
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon'
|
480
|
+
Enabled: true
|
481
|
+
# Allow ; to separate several expressions on the same line.
|
482
|
+
AllowAsExpressionSeparator: false
|
483
|
+
|
484
|
+
SignalException:
|
485
|
+
Description: 'Checks for proper usage of fail and raise.'
|
486
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
|
487
|
+
Enabled: true
|
488
|
+
EnforcedStyle: semantic
|
489
|
+
SupportedStyles:
|
490
|
+
- only_raise
|
491
|
+
- only_fail
|
492
|
+
- semantic
|
493
|
+
|
494
|
+
SingleLineBlockParams:
|
495
|
+
Description: 'Enforces the names of some block params.'
|
496
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
|
497
|
+
Enabled: false
|
498
|
+
Methods:
|
499
|
+
- reduce:
|
500
|
+
- a
|
501
|
+
- e
|
502
|
+
- inject:
|
503
|
+
- a
|
504
|
+
- e
|
505
|
+
|
506
|
+
SingleLineMethods:
|
507
|
+
Description: 'Avoid single-line methods.'
|
508
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
|
509
|
+
Enabled: true
|
510
|
+
AllowIfMethodIsEmpty: true
|
511
|
+
|
512
|
+
StringLiterals:
|
513
|
+
Description: 'Checks if uses of quotes match the configured preference.'
|
514
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
|
515
|
+
Enabled: true
|
516
|
+
EnforcedStyle: double_quotes
|
517
|
+
SupportedStyles:
|
518
|
+
- single_quotes
|
519
|
+
- double_quotes
|
520
|
+
|
521
|
+
SpaceAroundEqualsInParameterDefault:
|
522
|
+
Description: >-
|
523
|
+
Checks that the equals signs in parameter default assignments
|
524
|
+
have or don't have surrounding space depending on
|
525
|
+
configuration.
|
526
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-around-equals'
|
527
|
+
Enabled: true
|
528
|
+
EnforcedStyle: space
|
529
|
+
SupportedStyles:
|
530
|
+
- space
|
531
|
+
- no_space
|
532
|
+
|
533
|
+
SpaceBeforeBlockBraces:
|
534
|
+
Description: >-
|
535
|
+
Checks that the left block brace has or doesn't have space
|
536
|
+
before it.
|
537
|
+
Enabled: true
|
538
|
+
EnforcedStyle: space
|
539
|
+
SupportedStyles:
|
540
|
+
- space
|
541
|
+
- no_space
|
542
|
+
|
543
|
+
SpaceInsideBlockBraces:
|
544
|
+
Description: >-
|
545
|
+
Checks that block braces have or don't have surrounding space.
|
546
|
+
For blocks taking parameters, checks that the left brace has
|
547
|
+
or doesn't have trailing space.
|
548
|
+
Enabled: true
|
549
|
+
EnforcedStyle: space
|
550
|
+
SupportedStyles:
|
551
|
+
- space
|
552
|
+
- no_space
|
553
|
+
# Valid values are: space, no_space
|
554
|
+
EnforcedStyleForEmptyBraces: no_space
|
555
|
+
# Space between { and |. Overrides EnforcedStyle if there is a conflict.
|
556
|
+
SpaceBeforeBlockParameters: true
|
557
|
+
|
558
|
+
#TODO: ask team
|
559
|
+
SpaceInsideHashLiteralBraces:
|
560
|
+
Description: "Use spaces inside hash literal braces - or don't."
|
561
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
|
562
|
+
Enabled: false
|
563
|
+
EnforcedStyle: space
|
564
|
+
EnforcedStyleForEmptyBraces: no_space
|
565
|
+
SupportedStyles:
|
566
|
+
- space
|
567
|
+
- no_space
|
568
|
+
|
569
|
+
SymbolProc:
|
570
|
+
Description: 'Use symbols as procs instead of blocks when possible.'
|
571
|
+
Enabled: false
|
572
|
+
# A list of method names to be ignored by the check.
|
573
|
+
# The names should be fairly unique, otherwise you'll end up ignoring lots of code.
|
574
|
+
IgnoredMethods:
|
575
|
+
- respond_to
|
576
|
+
|
577
|
+
TrailingBlankLines:
|
578
|
+
Description: 'Checks trailing blank lines and final newline.'
|
579
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#newline-eof'
|
580
|
+
Enabled: true
|
581
|
+
EnforcedStyle: final_newline
|
582
|
+
SupportedStyles:
|
583
|
+
- final_newline
|
584
|
+
- final_blank_line
|
585
|
+
|
586
|
+
TrailingCommaInLiteral:
|
587
|
+
Description: 'Checks for trailing comma in parameter lists and literals.'
|
588
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
589
|
+
Enabled: true
|
590
|
+
# If EnforcedStyleForMultiline is comma, the cop allows a comma after the
|
591
|
+
# last item of a list, but only for lists where each item is on its own line.
|
592
|
+
EnforcedStyleForMultiline: comma
|
593
|
+
SupportedStyles:
|
594
|
+
- comma
|
595
|
+
- no_comma
|
596
|
+
|
597
|
+
# TrivialAccessors doesn't require exact name matches and doesn't allow
|
598
|
+
# predicated methods by default.
|
599
|
+
TrivialAccessors:
|
600
|
+
Description: 'Prefer attr_* methods to trivial readers/writers.'
|
601
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
|
602
|
+
Enabled: true
|
603
|
+
ExactNameMatch: true
|
604
|
+
AllowPredicates: false
|
605
|
+
# Allows trivial writers that don't end in an equal sign. e.g.
|
606
|
+
#
|
607
|
+
# def on_exception(action)
|
608
|
+
# @on_exception=action
|
609
|
+
# end
|
610
|
+
# on_exception :restart
|
611
|
+
#
|
612
|
+
# Commonly used in DSLs
|
613
|
+
AllowDSLWriters: false
|
614
|
+
Whitelist:
|
615
|
+
- to_ary
|
616
|
+
- to_a
|
617
|
+
- to_c
|
618
|
+
- to_enum
|
619
|
+
- to_h
|
620
|
+
- to_hash
|
621
|
+
- to_i
|
622
|
+
- to_int
|
623
|
+
- to_io
|
624
|
+
- to_open
|
625
|
+
- to_path
|
626
|
+
- to_proc
|
627
|
+
- to_r
|
628
|
+
- to_regexp
|
629
|
+
- to_str
|
630
|
+
- to_s
|
631
|
+
- to_sym
|
632
|
+
- to_param
|
633
|
+
|
634
|
+
VariableName:
|
635
|
+
Description: 'Use the configured style when naming variables.'
|
636
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
|
637
|
+
Enabled: true
|
638
|
+
EnforcedStyle: snake_case
|
639
|
+
SupportedStyles:
|
640
|
+
- snake_case
|
641
|
+
- camelCase
|
642
|
+
|
643
|
+
WhileUntilModifier:
|
644
|
+
Description: >-
|
645
|
+
Favor modifier while/until usage when you have a
|
646
|
+
single-line body.
|
647
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
|
648
|
+
Enabled: true
|
649
|
+
MaxLineLength: 100
|
650
|
+
|
651
|
+
WordArray:
|
652
|
+
Description: 'Use %w or %W for arrays of words.'
|
653
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
|
654
|
+
Enabled: true
|
655
|
+
MinSize: 0
|
656
|
+
|
657
|
+
##################### Metrics ##################################
|
658
|
+
|
659
|
+
BlockNesting:
|
660
|
+
Description: 'Avoid excessive block nesting'
|
661
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
|
662
|
+
Enabled: true
|
663
|
+
Max: 3
|
664
|
+
|
665
|
+
ClassLength:
|
666
|
+
Description: 'Avoid classes longer than 100 lines of code.'
|
667
|
+
Enabled: false
|
668
|
+
CountComments: false # count full line comments?
|
669
|
+
Max: 100
|
670
|
+
|
671
|
+
# Avoid complex methods.
|
672
|
+
CyclomaticComplexity:
|
673
|
+
Description: >-
|
674
|
+
A complexity metric that is strongy correlated to the number
|
675
|
+
of test cases needed to validate a method.
|
676
|
+
Enabled: true
|
677
|
+
Max: 6
|
678
|
+
|
679
|
+
LineLength:
|
680
|
+
Description: 'Limit lines to 120 characters.'
|
681
|
+
# YODA uses a custom value
|
682
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
|
683
|
+
Enabled: true
|
684
|
+
Max: 120
|
685
|
+
AllowURI: true
|
686
|
+
URISchemes:
|
687
|
+
- http
|
688
|
+
- https
|
689
|
+
Exclude:
|
690
|
+
- 'config/amqp_handlers.rb'
|
691
|
+
- 'config/amqp_wiring.rb'
|
692
|
+
|
693
|
+
MethodLength:
|
694
|
+
Description: 'Avoid methods longer than 10 lines of code.'
|
695
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
|
696
|
+
Enabled: true
|
697
|
+
CountComments: false # count full line comments?
|
698
|
+
Max: 10
|
699
|
+
Exclude:
|
700
|
+
- db/migrate/*.rb
|
701
|
+
|
702
|
+
ParameterLists:
|
703
|
+
Description: 'Avoid parameter lists longer than three or four parameters.'
|
704
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
|
705
|
+
Enabled: true
|
706
|
+
Max: 4
|
707
|
+
CountKeywordArgs: true
|
708
|
+
|
709
|
+
PerceivedComplexity:
|
710
|
+
Description: >-
|
711
|
+
A complexity metric geared towards measuring complexity for a
|
712
|
+
human reader.
|
713
|
+
Enabled: true
|
714
|
+
Max: 7
|
715
|
+
|
716
|
+
##################### Lint ##################################
|
717
|
+
|
718
|
+
# Allow safe assignment in conditions.
|
719
|
+
AssignmentInCondition:
|
720
|
+
Description: "Don't use assignment in conditions."
|
721
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
|
722
|
+
Enabled: true
|
723
|
+
AllowSafeAssignment: false
|
724
|
+
|
725
|
+
# Align ends correctly.
|
726
|
+
EndAlignment:
|
727
|
+
Description: 'Align ends correctly.'
|
728
|
+
Enabled: true
|
729
|
+
# The value `keyword` means that `end` should be aligned with the matching
|
730
|
+
# keyword (if, while, etc.).
|
731
|
+
# The value `variable` means that in assignments, `end` should be aligned
|
732
|
+
# with the start of the variable on the left hand side of `=`. In all other
|
733
|
+
# situations, `end` should still be aligned with the keyword.
|
734
|
+
AlignWith: keyword
|
735
|
+
SupportedStyles:
|
736
|
+
- keyword
|
737
|
+
- variable
|
738
|
+
|
739
|
+
DefEndAlignment:
|
740
|
+
Description: 'Align ends corresponding to defs correctly.'
|
741
|
+
Enabled: true
|
742
|
+
# The value `def` means that `end` should be aligned with the def keyword.
|
743
|
+
# The value `start_of_line` means that `end` should be aligned with method
|
744
|
+
# calls like `private`, `public`, etc, if present in front of the `def`
|
745
|
+
# keyword on the same line.
|
746
|
+
AlignWith: def
|
747
|
+
SupportedStyles:
|
748
|
+
- start_of_line
|
749
|
+
- def
|
750
|
+
|
751
|
+
##################### Rails ##################################
|
752
|
+
|
753
|
+
ActionFilter:
|
754
|
+
Description: 'Enforces consistent use of action filter methods.'
|
755
|
+
Enabled: true
|
756
|
+
EnforcedStyle: action
|
757
|
+
SupportedStyles:
|
758
|
+
- action
|
759
|
+
- filter
|
760
|
+
Include:
|
761
|
+
- app/controllers/**/*.rb
|
762
|
+
|
763
|
+
HasAndBelongsToMany:
|
764
|
+
Description: 'Prefer has_many :through to has_and_belongs_to_many.'
|
765
|
+
Enabled: true
|
766
|
+
Include:
|
767
|
+
- app/models/**/*.rb
|
768
|
+
|
769
|
+
Output:
|
770
|
+
Description: 'Checks for calls to puts, print, etc.'
|
771
|
+
Enabled: true
|
772
|
+
Include:
|
773
|
+
- app/**/*.rb
|
774
|
+
- config/**/*.rb
|
775
|
+
- db/**/*.rb
|
776
|
+
- lib/**/*.rb
|
777
|
+
Exclude:
|
778
|
+
- db/seeds.rb
|
779
|
+
|
780
|
+
ReadWriteAttribute:
|
781
|
+
Description: >-
|
782
|
+
Checks for read_attribute(:attr) and
|
783
|
+
write_attribute(:attr, val).
|
784
|
+
Enabled: true
|
785
|
+
Include:
|
786
|
+
- app/models/**/*.rb
|
787
|
+
|
788
|
+
ScopeArgs:
|
789
|
+
Description: 'Checks the arguments of ActiveRecord scopes.'
|
790
|
+
Enabled: true
|
791
|
+
Include:
|
792
|
+
- app/models/**/*.rb
|
793
|
+
|
794
|
+
Validation:
|
795
|
+
Description: 'Use validates :attribute, hash of validations.'
|
796
|
+
Enabled: true
|
797
|
+
Include:
|
798
|
+
- app/models/**/*.rb
|
799
|
+
|
800
|
+
InlineComment:
|
801
|
+
Description: 'Avoid inline comments.'
|
802
|
+
Enabled: false
|
803
|
+
|
804
|
+
MethodCalledOnDoEndBlock:
|
805
|
+
Description: 'Avoid chaining a method call on a do...end block.'
|
806
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
807
|
+
Enabled: true
|
808
|
+
|
809
|
+
SymbolArray:
|
810
|
+
Description: 'Use %i or %I for arrays of symbols.'
|
811
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-i'
|
812
|
+
Enabled: true
|
813
|
+
|
814
|
+
AccessorMethodName:
|
815
|
+
Description: Check the naming of accessor methods for get_/set_.
|
816
|
+
Enabled: true
|
817
|
+
|
818
|
+
Alias:
|
819
|
+
Description: 'Use alias_method instead of alias.'
|
820
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
|
821
|
+
Enabled: true
|
822
|
+
|
823
|
+
AlignArray:
|
824
|
+
Description: >-
|
825
|
+
Align the elements of an array literal if they span more than
|
826
|
+
one line.
|
827
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays'
|
828
|
+
Enabled: true
|
829
|
+
|
830
|
+
ArrayJoin:
|
831
|
+
Description: 'Use Array#join instead of Array#*.'
|
832
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
|
833
|
+
Enabled: true
|
834
|
+
|
835
|
+
AsciiComments:
|
836
|
+
Description: 'Use only ascii symbols in comments.'
|
837
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
|
838
|
+
Enabled: true
|
839
|
+
|
840
|
+
AsciiIdentifiers:
|
841
|
+
Description: 'Use only ascii symbols in identifiers.'
|
842
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
|
843
|
+
Enabled: true
|
844
|
+
|
845
|
+
Attr:
|
846
|
+
Description: 'Checks for uses of Module#attr.'
|
847
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
|
848
|
+
Enabled: true
|
849
|
+
|
850
|
+
BeginBlock:
|
851
|
+
Description: 'Avoid the use of BEGIN blocks.'
|
852
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks'
|
853
|
+
Enabled: true
|
854
|
+
|
855
|
+
BlockComments:
|
856
|
+
Description: 'Do not use block comments.'
|
857
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-block-comments'
|
858
|
+
Enabled: true
|
859
|
+
|
860
|
+
BlockEndNewline:
|
861
|
+
Description: 'Put end statement of multiline block on its own line.'
|
862
|
+
Enabled: true
|
863
|
+
|
864
|
+
BlockDelimiters:
|
865
|
+
Description: >-
|
866
|
+
Avoid using {...} for multi-line blocks (multiline chaining is always
|
867
|
+
ugly). Prefer {...} over do...end for single-line blocks.
|
868
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
869
|
+
Enabled: true
|
870
|
+
|
871
|
+
CaseEquality:
|
872
|
+
Description: 'Avoid explicit use of the case equality operator(===).'
|
873
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
|
874
|
+
Enabled: true
|
875
|
+
|
876
|
+
CharacterLiteral:
|
877
|
+
Description: 'Checks for uses of character literals.'
|
878
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
|
879
|
+
Enabled: true
|
880
|
+
|
881
|
+
ClassAndModuleCamelCase:
|
882
|
+
Description: 'Use CamelCase for classes and modules.'
|
883
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#camelcase-classes'
|
884
|
+
Enabled: true
|
885
|
+
|
886
|
+
ClassMethods:
|
887
|
+
Description: 'Use self when defining module/class methods.'
|
888
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#def-self-singletons'
|
889
|
+
Enabled: true
|
890
|
+
|
891
|
+
ClassVars:
|
892
|
+
Description: 'Avoid the use of class variables.'
|
893
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
|
894
|
+
Enabled: true
|
895
|
+
|
896
|
+
ColonMethodCall:
|
897
|
+
Description: 'Do not use :: for method call.'
|
898
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
|
899
|
+
Enabled: true
|
900
|
+
|
901
|
+
CommentIndentation:
|
902
|
+
Description: 'Indentation of comments.'
|
903
|
+
Enabled: true
|
904
|
+
|
905
|
+
ConstantName:
|
906
|
+
Description: 'Constants should use SCREAMING_SNAKE_CASE.'
|
907
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case'
|
908
|
+
Enabled: true
|
909
|
+
|
910
|
+
DefWithParentheses:
|
911
|
+
Description: 'Use def with parentheses when there are arguments.'
|
912
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
|
913
|
+
Enabled: true
|
914
|
+
|
915
|
+
DeprecatedHashMethods:
|
916
|
+
Description: 'Checks for use of deprecated Hash methods.'
|
917
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-key'
|
918
|
+
Enabled: true
|
919
|
+
|
920
|
+
Documentation:
|
921
|
+
Description: 'Document classes and non-namespace modules.'
|
922
|
+
Enabled: false
|
923
|
+
|
924
|
+
DoubleNegation:
|
925
|
+
Description: 'Checks for uses of double negation (!!).'
|
926
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
|
927
|
+
Enabled: true
|
928
|
+
|
929
|
+
EachWithObject:
|
930
|
+
Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
|
931
|
+
Enabled: false
|
932
|
+
|
933
|
+
EmptyLines:
|
934
|
+
Description: "Don't use several empty lines in a row."
|
935
|
+
Enabled: true
|
936
|
+
|
937
|
+
EmptyLinesAroundAccessModifier:
|
938
|
+
Description: "Keep blank lines around access modifiers."
|
939
|
+
Enabled: true
|
940
|
+
|
941
|
+
EmptyLinesAroundBlockBody:
|
942
|
+
Description: "Keeps track of empty lines around block bodies."
|
943
|
+
Enabled: true
|
944
|
+
EnforcedStyle: no_empty_lines
|
945
|
+
SupportedStyles:
|
946
|
+
- empty_lines
|
947
|
+
- no_empty_lines
|
948
|
+
|
949
|
+
EmptyLiteral:
|
950
|
+
Description: 'Prefer literals to Array.new/Hash.new/String.new.'
|
951
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
|
952
|
+
Enabled: true
|
953
|
+
|
954
|
+
EndBlock:
|
955
|
+
Description: 'Avoid the use of END blocks.'
|
956
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-END-blocks'
|
957
|
+
Enabled: true
|
958
|
+
|
959
|
+
EndOfLine:
|
960
|
+
Description: 'Use Unix-style line endings.'
|
961
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#crlf'
|
962
|
+
Enabled: true
|
963
|
+
|
964
|
+
EvenOdd:
|
965
|
+
Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
|
966
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
967
|
+
Enabled: true
|
968
|
+
|
969
|
+
FlipFlop:
|
970
|
+
Description: 'Checks for flip flops'
|
971
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
|
972
|
+
Enabled: true
|
973
|
+
|
974
|
+
IfWithSemicolon:
|
975
|
+
Description: 'Never use if x; .... Use the ternary operator instead.'
|
976
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
|
977
|
+
Enabled: true
|
978
|
+
|
979
|
+
IndentationConsistency:
|
980
|
+
Description: 'Keep indentation straight.'
|
981
|
+
Enabled: true
|
982
|
+
|
983
|
+
IndentationWidth:
|
984
|
+
Description: 'Use 2 spaces for indentation.'
|
985
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
|
986
|
+
Enabled: true
|
987
|
+
|
988
|
+
IndentArray:
|
989
|
+
Description: >-
|
990
|
+
Checks the indentation of the first element in an array
|
991
|
+
literal.
|
992
|
+
Enabled: true
|
993
|
+
|
994
|
+
InfiniteLoop:
|
995
|
+
Description: 'Use Kernel#loop for infinite loops.'
|
996
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#infinite-loop'
|
997
|
+
Enabled: true
|
998
|
+
|
999
|
+
Lambda:
|
1000
|
+
Description: 'Use the new lambda literal syntax for single-line blocks.'
|
1001
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
|
1002
|
+
Enabled: true
|
1003
|
+
|
1004
|
+
LeadingCommentSpace:
|
1005
|
+
Description: 'Comments should start with a space.'
|
1006
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
|
1007
|
+
Enabled: true
|
1008
|
+
|
1009
|
+
LineEndConcatenation:
|
1010
|
+
Description: >-
|
1011
|
+
Use \ instead of + or << to concatenate two string literals at
|
1012
|
+
line end.
|
1013
|
+
Enabled: true
|
1014
|
+
|
1015
|
+
MethodCallParentheses:
|
1016
|
+
Description: 'Do not use parentheses for method calls with no arguments.'
|
1017
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
|
1018
|
+
Enabled: true
|
1019
|
+
|
1020
|
+
ModuleFunction:
|
1021
|
+
Description: 'Checks for usage of `extend self` in modules.'
|
1022
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
|
1023
|
+
Enabled: true
|
1024
|
+
|
1025
|
+
MultilineBlockChain:
|
1026
|
+
Description: 'Avoid multi-line chains of blocks.'
|
1027
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
1028
|
+
Enabled: true
|
1029
|
+
|
1030
|
+
MultilineBlockLayout:
|
1031
|
+
Description: 'Ensures newlines after multiline block do statements.'
|
1032
|
+
Enabled: true
|
1033
|
+
|
1034
|
+
MultilineIfThen:
|
1035
|
+
Description: 'Never use then for multi-line if/unless.'
|
1036
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-then'
|
1037
|
+
Enabled: true
|
1038
|
+
|
1039
|
+
MultilineTernaryOperator:
|
1040
|
+
Description: >-
|
1041
|
+
Avoid multi-line ?: (the ternary operator);
|
1042
|
+
use if/unless instead.
|
1043
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary'
|
1044
|
+
Enabled: true
|
1045
|
+
|
1046
|
+
NegatedIf:
|
1047
|
+
Description: >-
|
1048
|
+
Favor unless over if for negative conditions
|
1049
|
+
(or control flow or).
|
1050
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
|
1051
|
+
Enabled: true
|
1052
|
+
|
1053
|
+
NegatedWhile:
|
1054
|
+
Description: 'Favor until over while for negative conditions.'
|
1055
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
|
1056
|
+
Enabled: true
|
1057
|
+
|
1058
|
+
NestedTernaryOperator:
|
1059
|
+
Description: 'Use one expression per branch in a ternary operator.'
|
1060
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-ternary'
|
1061
|
+
Enabled: true
|
1062
|
+
|
1063
|
+
NilComparison:
|
1064
|
+
Description: 'Prefer x.nil? to x == nil.'
|
1065
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
1066
|
+
Enabled: true
|
1067
|
+
|
1068
|
+
Not:
|
1069
|
+
Description: 'Use ! instead of not.'
|
1070
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
|
1071
|
+
Enabled: true
|
1072
|
+
|
1073
|
+
OneLineConditional:
|
1074
|
+
Description: >-
|
1075
|
+
Favor the ternary operator(?:) over
|
1076
|
+
if/then/else/end constructs.
|
1077
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
|
1078
|
+
Enabled: true
|
1079
|
+
|
1080
|
+
OpMethod:
|
1081
|
+
Description: 'When defining binary operators, name the argument other.'
|
1082
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
|
1083
|
+
Enabled: true
|
1084
|
+
|
1085
|
+
PerlBackrefs:
|
1086
|
+
Description: 'Avoid Perl-style regex back references.'
|
1087
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
|
1088
|
+
Enabled: true
|
1089
|
+
|
1090
|
+
Proc:
|
1091
|
+
Description: 'Use proc instead of Proc.new.'
|
1092
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
|
1093
|
+
Enabled: true
|
1094
|
+
|
1095
|
+
RedundantBegin:
|
1096
|
+
Description: "Don't use begin blocks when they are not needed."
|
1097
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#begin-implicit'
|
1098
|
+
Enabled: true
|
1099
|
+
|
1100
|
+
RedundantException:
|
1101
|
+
Description: "Checks for an obsolete RuntimeException argument in raise/fail."
|
1102
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror'
|
1103
|
+
Enabled: true
|
1104
|
+
|
1105
|
+
RedundantSelf:
|
1106
|
+
Description: "Don't use self where it's not needed."
|
1107
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-self-unless-required'
|
1108
|
+
Enabled: true
|
1109
|
+
|
1110
|
+
RescueModifier:
|
1111
|
+
Description: 'Avoid using rescue in its modifier form.'
|
1112
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers'
|
1113
|
+
Enabled: true
|
1114
|
+
|
1115
|
+
SelfAssignment:
|
1116
|
+
Description: >-
|
1117
|
+
Checks for places where self-assignment shorthand should have
|
1118
|
+
been used.
|
1119
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
|
1120
|
+
Enabled: true
|
1121
|
+
|
1122
|
+
SpaceBeforeFirstArg:
|
1123
|
+
Description: >-
|
1124
|
+
Checks that exactly one space is used between a method name
|
1125
|
+
and the first argument for method calls without parentheses.
|
1126
|
+
Enabled: false
|
1127
|
+
|
1128
|
+
SpaceAfterColon:
|
1129
|
+
Description: 'Use spaces after colons.'
|
1130
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
|
1131
|
+
Enabled: true
|
1132
|
+
|
1133
|
+
SpaceAfterComma:
|
1134
|
+
Description: 'Use spaces after commas.'
|
1135
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
|
1136
|
+
Enabled: true
|
1137
|
+
|
1138
|
+
SpaceAfterMethodName:
|
1139
|
+
Description: >-
|
1140
|
+
Never put a space between a method name and the opening
|
1141
|
+
parenthesis in a method definition.
|
1142
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
|
1143
|
+
Enabled: true
|
1144
|
+
|
1145
|
+
SpaceAfterNot:
|
1146
|
+
Description: Tracks redundant space after the ! operator.
|
1147
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-bang'
|
1148
|
+
Enabled: true
|
1149
|
+
|
1150
|
+
SpaceAfterSemicolon:
|
1151
|
+
Description: 'Use spaces after semicolons.'
|
1152
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
|
1153
|
+
Enabled: true
|
1154
|
+
|
1155
|
+
SpaceBeforeComma:
|
1156
|
+
Description: 'No spaces before commas.'
|
1157
|
+
Enabled: true
|
1158
|
+
|
1159
|
+
SpaceBeforeComment:
|
1160
|
+
Description: >-
|
1161
|
+
Checks for missing space between code and a comment on the
|
1162
|
+
same line.
|
1163
|
+
Enabled: true
|
1164
|
+
|
1165
|
+
SpaceBeforeSemicolon:
|
1166
|
+
Description: 'No spaces before semicolons.'
|
1167
|
+
Enabled: true
|
1168
|
+
|
1169
|
+
SpaceAroundOperators:
|
1170
|
+
Description: 'Use spaces around operators.'
|
1171
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
|
1172
|
+
Enabled: true
|
1173
|
+
|
1174
|
+
SpaceInsideBrackets:
|
1175
|
+
Description: 'No spaces after [ or before ].'
|
1176
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
|
1177
|
+
Enabled: false
|
1178
|
+
|
1179
|
+
SpaceInsideParens:
|
1180
|
+
Description: 'No spaces after ( or before ).'
|
1181
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
|
1182
|
+
Enabled: false
|
1183
|
+
|
1184
|
+
SpaceInsideRangeLiteral:
|
1185
|
+
Description: 'No spaces inside range literals.'
|
1186
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals'
|
1187
|
+
Enabled: true
|
1188
|
+
|
1189
|
+
SpecialGlobalVars:
|
1190
|
+
Description: 'Avoid Perl-style global variables.'
|
1191
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
|
1192
|
+
Enabled: true
|
1193
|
+
|
1194
|
+
Tab:
|
1195
|
+
Description: 'No hard tabs.'
|
1196
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
|
1197
|
+
Enabled: true
|
1198
|
+
|
1199
|
+
TrailingWhitespace:
|
1200
|
+
Description: 'Avoid trailing whitespace.'
|
1201
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace'
|
1202
|
+
Enabled: true
|
1203
|
+
|
1204
|
+
UnlessElse:
|
1205
|
+
Description: >-
|
1206
|
+
Never use unless with else. Rewrite these with the positive
|
1207
|
+
case first.
|
1208
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-else-with-unless'
|
1209
|
+
Enabled: true
|
1210
|
+
|
1211
|
+
UnneededCapitalW:
|
1212
|
+
Description: 'Checks for %W when interpolation is not needed.'
|
1213
|
+
Enabled: true
|
1214
|
+
|
1215
|
+
UnneededPercentQ:
|
1216
|
+
Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
|
1217
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q'
|
1218
|
+
Enabled: true
|
1219
|
+
|
1220
|
+
CommandLiteral:
|
1221
|
+
Description: Use `` or %x around command literals.
|
1222
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-x
|
1223
|
+
Enabled: true
|
1224
|
+
EnforcedStyle: backticks
|
1225
|
+
SupportedStyles:
|
1226
|
+
- backticks
|
1227
|
+
- percent_x
|
1228
|
+
- mixed
|
1229
|
+
AllowInnerBackticks: false
|
1230
|
+
|
1231
|
+
VariableInterpolation:
|
1232
|
+
Description: >-
|
1233
|
+
Don't interpolate global, instance and class variables
|
1234
|
+
directly in strings.
|
1235
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
|
1236
|
+
Enabled: true
|
1237
|
+
|
1238
|
+
WhenThen:
|
1239
|
+
Description: 'Use when x then ... for one-line cases.'
|
1240
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
|
1241
|
+
Enabled: true
|
1242
|
+
|
1243
|
+
WhileUntilDo:
|
1244
|
+
Description: 'Checks for redundant do after while or until.'
|
1245
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do'
|
1246
|
+
Enabled: true
|
1247
|
+
|
1248
|
+
AmbiguousOperator:
|
1249
|
+
Description: >-
|
1250
|
+
Checks for ambiguous operators in the first argument of a
|
1251
|
+
method invocation without parentheses.
|
1252
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
|
1253
|
+
Enabled: true
|
1254
|
+
|
1255
|
+
AmbiguousRegexpLiteral:
|
1256
|
+
Description: >-
|
1257
|
+
Checks for ambiguous regexp literals in the first argument of
|
1258
|
+
a method invocation without parenthesis.
|
1259
|
+
Enabled: true
|
1260
|
+
|
1261
|
+
BlockAlignment:
|
1262
|
+
Description: 'Align block ends correctly.'
|
1263
|
+
Enabled: true
|
1264
|
+
|
1265
|
+
ConditionPosition:
|
1266
|
+
Description: >-
|
1267
|
+
Checks for condition placed in a confusing position relative to
|
1268
|
+
the keyword.
|
1269
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
|
1270
|
+
Enabled: true
|
1271
|
+
|
1272
|
+
Debugger:
|
1273
|
+
Description: 'Check for debugger calls.'
|
1274
|
+
Enabled: true
|
1275
|
+
|
1276
|
+
DeprecatedClassMethods:
|
1277
|
+
Description: 'Check for deprecated class method calls.'
|
1278
|
+
Enabled: true
|
1279
|
+
|
1280
|
+
ElseLayout:
|
1281
|
+
Description: 'Check for odd code arrangement in an else block.'
|
1282
|
+
Enabled: true
|
1283
|
+
|
1284
|
+
EmptyEnsure:
|
1285
|
+
Description: 'Checks for empty ensure block.'
|
1286
|
+
Enabled: true
|
1287
|
+
|
1288
|
+
EmptyInterpolation:
|
1289
|
+
Description: 'Checks for empty string interpolation.'
|
1290
|
+
Enabled: true
|
1291
|
+
|
1292
|
+
EndInMethod:
|
1293
|
+
Description: 'END blocks should not be placed inside method definitions.'
|
1294
|
+
Enabled: true
|
1295
|
+
|
1296
|
+
EnsureReturn:
|
1297
|
+
Description: 'Never use return in an ensure block.'
|
1298
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-return-ensure'
|
1299
|
+
Enabled: true
|
1300
|
+
|
1301
|
+
Eval:
|
1302
|
+
Description: 'The use of eval represents a serious security risk.'
|
1303
|
+
Enabled: true
|
1304
|
+
|
1305
|
+
HandleExceptions:
|
1306
|
+
Description: "Don't suppress exception."
|
1307
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
|
1308
|
+
Enabled: true
|
1309
|
+
|
1310
|
+
InvalidCharacterLiteral:
|
1311
|
+
Description: >-
|
1312
|
+
Checks for invalid character literals with a non-escaped
|
1313
|
+
whitespace character.
|
1314
|
+
Enabled: true
|
1315
|
+
|
1316
|
+
LiteralInCondition:
|
1317
|
+
Description: 'Checks of literals used in conditions.'
|
1318
|
+
Enabled: true
|
1319
|
+
|
1320
|
+
LiteralInInterpolation:
|
1321
|
+
Description: 'Checks for literals used in interpolation.'
|
1322
|
+
Enabled: true
|
1323
|
+
|
1324
|
+
Loop:
|
1325
|
+
Description: >-
|
1326
|
+
Use Kernel#loop with break rather than begin/end/until or
|
1327
|
+
begin/end/while for post-loop tests.
|
1328
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
|
1329
|
+
Enabled: true
|
1330
|
+
|
1331
|
+
ParenthesesAsGroupedExpression:
|
1332
|
+
Description: >-
|
1333
|
+
Checks for method calls with a space before the opening
|
1334
|
+
parenthesis.
|
1335
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
|
1336
|
+
Enabled: true
|
1337
|
+
|
1338
|
+
RequireParentheses:
|
1339
|
+
Description: >-
|
1340
|
+
Use parentheses in the method call to avoid confusion
|
1341
|
+
about precedence.
|
1342
|
+
Enabled: true
|
1343
|
+
|
1344
|
+
RescueException:
|
1345
|
+
Description: 'Avoid rescuing the Exception class.'
|
1346
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-blind-rescues'
|
1347
|
+
Enabled: true
|
1348
|
+
|
1349
|
+
ShadowingOuterLocalVariable:
|
1350
|
+
Description: >-
|
1351
|
+
Do not use the same name as outer local variable
|
1352
|
+
for block arguments or block local variables.
|
1353
|
+
Enabled: true
|
1354
|
+
|
1355
|
+
SpaceBeforeFirstArg:
|
1356
|
+
Description: >-
|
1357
|
+
Put a space between a method name and the first argument
|
1358
|
+
in a method call without parentheses.
|
1359
|
+
Enabled: true
|
1360
|
+
|
1361
|
+
StringConversionInInterpolation:
|
1362
|
+
Description: 'Checks for Object#to_s usage in string interpolation.'
|
1363
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-to-s'
|
1364
|
+
Enabled: true
|
1365
|
+
|
1366
|
+
UnderscorePrefixedVariableName:
|
1367
|
+
Description: 'Do not use prefix `_` for a variable that is used.'
|
1368
|
+
Enabled: true
|
1369
|
+
|
1370
|
+
UnusedBlockArgument:
|
1371
|
+
Description: 'Checks for unused block arguments.'
|
1372
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
|
1373
|
+
Enabled: true
|
1374
|
+
|
1375
|
+
UnusedMethodArgument:
|
1376
|
+
Description: 'Checks for unused method arguments.'
|
1377
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
|
1378
|
+
Enabled: true
|
1379
|
+
|
1380
|
+
UnreachableCode:
|
1381
|
+
Description: 'Unreachable code.'
|
1382
|
+
Enabled: true
|
1383
|
+
|
1384
|
+
UselessAccessModifier:
|
1385
|
+
Description: 'Checks for useless access modifiers.'
|
1386
|
+
Enabled: true
|
1387
|
+
|
1388
|
+
UselessAssignment:
|
1389
|
+
Description: 'Checks for useless assignment to a local variable.'
|
1390
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
|
1391
|
+
Enabled: true
|
1392
|
+
|
1393
|
+
UselessComparison:
|
1394
|
+
Description: 'Checks for comparison of something with itself.'
|
1395
|
+
Enabled: true
|
1396
|
+
|
1397
|
+
UselessElseWithoutRescue:
|
1398
|
+
Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
|
1399
|
+
Enabled: true
|
1400
|
+
|
1401
|
+
UselessSetterCall:
|
1402
|
+
Description: 'Checks for useless setter call to a local variable.'
|
1403
|
+
Enabled: true
|
1404
|
+
|
1405
|
+
Void:
|
1406
|
+
Description: 'Possible use of operator/literal/variable in void context.'
|
1407
|
+
Enabled: true
|
1408
|
+
|
1409
|
+
Rails/Delegate:
|
1410
|
+
Enabled: false
|
1411
|
+
|
1412
|
+
Style/MultilineOperationIndentation:
|
1413
|
+
EnforcedStyle: indented
|
1414
|
+
SupportedStyles:
|
1415
|
+
- aligned
|
1416
|
+
- indented
|