kt-paperclip 6.4.2 → 7.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -1
  3. data/.hound.yml +3 -1057
  4. data/.rubocop.yml +1059 -1
  5. data/.travis.yml +5 -5
  6. data/Appraisals +6 -0
  7. data/CONTRIBUTING.md +4 -5
  8. data/Gemfile +2 -2
  9. data/NEWS +31 -0
  10. data/README.md +8 -7
  11. data/features/step_definitions/attachment_steps.rb +11 -1
  12. data/gemfiles/4.2.gemfile +1 -1
  13. data/gemfiles/5.0.gemfile +1 -1
  14. data/gemfiles/5.1.gemfile +1 -1
  15. data/gemfiles/5.2.gemfile +1 -1
  16. data/gemfiles/6.0.gemfile +1 -1
  17. data/gemfiles/6.1.gemfile +21 -0
  18. data/gemfiles/7.0.gemfile +21 -0
  19. data/lib/paperclip/attachment.rb +1 -1
  20. data/lib/paperclip/content_type_detector.rb +10 -5
  21. data/lib/paperclip/interpolations.rb +6 -2
  22. data/lib/paperclip/media_type_spoof_detector.rb +2 -0
  23. data/lib/paperclip/schema.rb +1 -1
  24. data/lib/paperclip/storage/filesystem.rb +1 -1
  25. data/lib/paperclip/storage/fog.rb +1 -1
  26. data/lib/paperclip/storage/s3.rb +18 -4
  27. data/lib/paperclip/validators/attachment_file_name_validator.rb +1 -1
  28. data/lib/paperclip/validators/attachment_size_validator.rb +3 -2
  29. data/lib/paperclip/version.rb +1 -1
  30. data/lib/paperclip.rb +1 -2
  31. data/paperclip.gemspec +2 -2
  32. data/spec/paperclip/content_type_detector_spec.rb +7 -0
  33. data/spec/paperclip/io_adapters/abstract_adapter_spec.rb +1 -1
  34. data/spec/paperclip/io_adapters/file_adapter_spec.rb +1 -1
  35. data/spec/paperclip/storage/filesystem_spec.rb +23 -0
  36. data/spec/paperclip/storage/fog_spec.rb +46 -0
  37. data/spec/paperclip/storage/s3_spec.rb +69 -0
  38. data/spec/paperclip/validators_spec.rb +21 -6
  39. data/spec/support/fixtures/sample.xlsm +0 -0
  40. metadata +118 -9
data/.hound.yml CHANGED
@@ -1,1057 +1,3 @@
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
- - 'vendor/**/*'
22
- - 'gemfiles/vendor/**/*'
23
- DisplayCopNames: false
24
- StyleGuideCopsOnly: false
25
- Naming/AccessorMethodName:
26
- Description: Check the naming of accessor methods for get_/set_.
27
- Enabled: false
28
- Naming/AsciiIdentifiers:
29
- Description: Use only ascii symbols in identifiers.
30
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-identifiers
31
- Enabled: false
32
- Naming/BinaryOperatorParameterName:
33
- Description: When defining binary operators, name the argument other.
34
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#other-arg
35
- Enabled: false
36
- Naming/ClassAndModuleCamelCase:
37
- Description: Use CamelCase for classes and modules.
38
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#camelcase-classes
39
- Enabled: true
40
- Naming/ConstantName:
41
- Description: Constants should use SCREAMING_SNAKE_CASE.
42
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#screaming-snake-case
43
- Enabled: true
44
- Naming/FileName:
45
- Description: Use snake_case for source file names.
46
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
47
- Enabled: false
48
- Exclude: []
49
- Naming/MemoizedInstanceVariableName:
50
- Enabled: false
51
- Naming/MethodName:
52
- Description: Use the configured style when naming methods.
53
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
54
- Enabled: true
55
- EnforcedStyle: snake_case
56
- SupportedStyles:
57
- - snake_case
58
- - camelCase
59
- Naming/PredicateName:
60
- Description: Check the names of predicate methods.
61
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
62
- Enabled: true
63
- NamePrefix:
64
- - is_
65
- - has_
66
- - have_
67
- ForbiddenPrefixes:
68
- - is_
69
- Naming/VariableName:
70
- Description: Use the configured style when naming variables.
71
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
72
- Enabled: true
73
- EnforcedStyle: snake_case
74
- SupportedStyles:
75
- - snake_case
76
- - camelCase
77
- Rails:
78
- Enabled: true
79
- Style/AndOr:
80
- Description: Use &&/|| instead of and/or.
81
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-and-or-or
82
- Enabled: true
83
- EnforcedStyle: always
84
- SupportedStyles:
85
- - always
86
- - conditionals
87
- Style/BarePercentLiterals:
88
- Description: Checks if usage of %() or %Q() matches configuration.
89
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand
90
- Enabled: true
91
- EnforcedStyle: bare_percent
92
- SupportedStyles:
93
- - percent_q
94
- - bare_percent
95
- Style/ClassAndModuleChildren:
96
- Description: Checks style of children classes and modules.
97
- Enabled: false
98
- EnforcedStyle: nested
99
- SupportedStyles:
100
- - nested
101
- - compact
102
- Style/ClassCheck:
103
- Description: Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.
104
- Enabled: true
105
- EnforcedStyle: is_a?
106
- SupportedStyles:
107
- - is_a?
108
- - kind_of?
109
- Style/CollectionMethods:
110
- Description: Preferred collection methods.
111
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
112
- Enabled: true
113
- PreferredMethods:
114
- collect: map
115
- collect!: map!
116
- inject: reduce
117
- detect: find
118
- find_all: select
119
- find: detect
120
- Style/CommentAnnotation:
121
- Description: Checks formatting of special comments (TODO, FIXME, OPTIMIZE, HACK,
122
- REVIEW).
123
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#annotate-keywords
124
- Enabled: false
125
- Keywords:
126
- - TODO
127
- - FIXME
128
- - OPTIMIZE
129
- - HACK
130
- - REVIEW
131
- Style/Encoding:
132
- Description: Use UTF-8 as the source file encoding.
133
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#utf-8
134
- Enabled: false
135
- Style/FrozenStringLiteralComment:
136
- Description: >-
137
- Add the frozen_string_literal comment to the top of files
138
- to help transition from Ruby 2.3.0 to Ruby 3.0.
139
- Enabled: false
140
- Style/For:
141
- Description: Checks use of for or each in multiline loops.
142
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-for-loops
143
- Enabled: true
144
- EnforcedStyle: each
145
- SupportedStyles:
146
- - for
147
- - each
148
- Style/FormatString:
149
- Description: Enforce the use of Kernel#sprintf, Kernel#format or String#%.
150
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#sprintf
151
- Enabled: false
152
- EnforcedStyle: format
153
- SupportedStyles:
154
- - format
155
- - sprintf
156
- - percent
157
- Style/GlobalVars:
158
- Description: Do not introduce global variables.
159
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#instance-vars
160
- Enabled: false
161
- AllowedVariables: []
162
- Style/GuardClause:
163
- Description: Check for conditionals that can be replaced with guard clauses
164
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
165
- Enabled: false
166
- MinBodyLength: 1
167
- Style/HashSyntax:
168
- Description: 'Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax { :a =>
169
- 1, :b => 2 }.'
170
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-literals
171
- Enabled: true
172
- EnforcedStyle: ruby19
173
- SupportedStyles:
174
- - ruby19
175
- - hash_rockets
176
- Style/LambdaCall:
177
- Description: Use lambda.call(...) instead of lambda.(...).
178
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc-call
179
- Enabled: false
180
- EnforcedStyle: call
181
- SupportedStyles:
182
- - call
183
- - braces
184
- Style/Next:
185
- Description: Use `next` to skip iteration instead of a condition at the end.
186
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
187
- Enabled: false
188
- EnforcedStyle: skip_modifier_ifs
189
- MinBodyLength: 3
190
- SupportedStyles:
191
- - skip_modifier_ifs
192
- - always
193
- Style/NonNilCheck:
194
- Description: Checks for redundant nil checks.
195
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks
196
- Enabled: true
197
- IncludeSemanticChanges: false
198
- Style/MethodDefParentheses:
199
- Description: Checks if the method definitions have or don't have parentheses.
200
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens
201
- Enabled: true
202
- EnforcedStyle: require_parentheses
203
- SupportedStyles:
204
- - require_parentheses
205
- - require_no_parentheses
206
- Style/NumericLiterals:
207
- Description: Add underscores to large numeric literals to improve their readability.
208
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics
209
- Enabled: false
210
- MinDigits: 5
211
- Style/NumericPredicate:
212
- Enabled: false
213
- Style/ParenthesesAroundCondition:
214
- Description: Don't use parentheses around the condition of an if/unless/while.
215
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-parens-if
216
- Enabled: true
217
- AllowSafeAssignment: true
218
- Style/PercentLiteralDelimiters:
219
- Description: Use `%`-literal delimiters consistently
220
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
221
- Enabled: false
222
- PreferredDelimiters:
223
- "%": "()"
224
- "%i": "()"
225
- "%q": "()"
226
- "%Q": "()"
227
- "%r": "{}"
228
- "%s": "()"
229
- "%w": "()"
230
- "%W": "()"
231
- "%x": "()"
232
- Style/PercentQLiterals:
233
- Description: Checks if uses of %Q/%q match the configured preference.
234
- Enabled: true
235
- EnforcedStyle: lower_case_q
236
- SupportedStyles:
237
- - lower_case_q
238
- - upper_case_q
239
- Style/RaiseArgs:
240
- Description: Checks the arguments passed to raise/fail.
241
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
242
- Enabled: false
243
- EnforcedStyle: exploded
244
- SupportedStyles:
245
- - compact
246
- - exploded
247
- Style/RedundantReturn:
248
- Description: Don't use return where it's not required.
249
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-explicit-return
250
- Enabled: true
251
- AllowMultipleReturnValues: false
252
- Style/RegexpLiteral:
253
- Description: Use %r for regular expressions matching more than `MaxSlashes` '/'
254
- characters. Use %r only for regular expressions matching more than `MaxSlashes`
255
- '/' character.
256
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-r
257
- Enabled: false
258
- Style/Semicolon:
259
- Description: Don't use semicolons to terminate expressions.
260
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon
261
- Enabled: true
262
- AllowAsExpressionSeparator: false
263
- Style/SignalException:
264
- Description: Checks for proper usage of fail and raise.
265
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
266
- Enabled: false
267
- EnforcedStyle: semantic
268
- SupportedStyles:
269
- - only_raise
270
- - only_fail
271
- - semantic
272
- Style/SingleLineBlockParams:
273
- Description: Enforces the names of some block params.
274
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
275
- Enabled: false
276
- Methods:
277
- - reduce:
278
- - a
279
- - e
280
- - inject:
281
- - a
282
- - e
283
- Style/SingleLineMethods:
284
- Description: Avoid single-line methods.
285
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
286
- Enabled: false
287
- AllowIfMethodIsEmpty: true
288
- Style/StringLiterals:
289
- Description: Checks if uses of quotes match the configured preference.
290
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
291
- Enabled: true
292
- EnforcedStyle: double_quotes
293
- SupportedStyles:
294
- - single_quotes
295
- - double_quotes
296
- Style/StringLiteralsInInterpolation:
297
- Description: Checks if uses of quotes inside expressions in interpolated strings
298
- match the configured preference.
299
- Enabled: true
300
- EnforcedStyle: single_quotes
301
- SupportedStyles:
302
- - single_quotes
303
- - double_quotes
304
- Style/SymbolProc:
305
- Description: Use symbols as procs instead of blocks when possible.
306
- Enabled: true
307
- IgnoredMethods:
308
- - respond_to
309
- Style/TrailingCommaInArrayLiteral:
310
- EnforcedStyleForMultiline: comma
311
- Enabled: true
312
- Style/TrailingCommaInHashLiteral:
313
- EnforcedStyleForMultiline: comma
314
- Enabled: true
315
- Style/TrailingCommaInArguments:
316
- Description: Checks for trailing comma in parameter lists and literals.
317
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
318
- Enabled: true
319
- EnforcedStyleForMultiline: comma
320
- SupportedStylesForMultiline:
321
- - comma
322
- - no_comma
323
- Style/TrivialAccessors:
324
- Description: Prefer attr_* methods to trivial readers/writers.
325
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr_family
326
- Enabled: false
327
- ExactNameMatch: false
328
- AllowPredicates: false
329
- AllowDSLWriters: false
330
- AllowedMethods:
331
- - to_ary
332
- - to_a
333
- - to_c
334
- - to_enum
335
- - to_h
336
- - to_hash
337
- - to_i
338
- - to_int
339
- - to_io
340
- - to_open
341
- - to_path
342
- - to_proc
343
- - to_r
344
- - to_regexp
345
- - to_str
346
- - to_s
347
- - to_sym
348
- Style/WordArray:
349
- Description: Use %w or %W for arrays of words.
350
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-w
351
- Enabled: false
352
- MinSize: 0
353
- WordRegex: !ruby/regexp /\A[\p{Word}]+\z/
354
- Metrics/AbcSize:
355
- Description: A calculated magnitude based on number of assignments, branches, and
356
- conditions.
357
- Enabled: true
358
- Max: 15
359
- Metrics/BlockLength:
360
- Exclude:
361
- - "spec/**/*"
362
- Metrics/BlockNesting:
363
- Description: Avoid excessive block nesting
364
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count
365
- Enabled: true
366
- Max: 3
367
- Metrics/ClassLength:
368
- Description: Avoid classes longer than 100 lines of code.
369
- Enabled: false
370
- CountComments: false
371
- Max: 100
372
- Metrics/CyclomaticComplexity:
373
- Description: A complexity metric that is strongly correlated to the number of test
374
- cases needed to validate a method.
375
- Enabled: true
376
- Max: 6
377
- Layout/LineLength:
378
- Description: Limit lines to 120 characters.
379
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#120-character-limits
380
- Enabled: true
381
- Max: 120
382
- AllowURI: true
383
- URISchemes:
384
- - http
385
- - https
386
- Exclude:
387
- - config/initializers/new_framework_defaults_6_0.rb
388
- Metrics/MethodLength:
389
- Description: Avoid methods longer than 15 lines of code.
390
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
391
- Enabled: true
392
- CountComments: true
393
- Max: 15
394
- Exclude:
395
- - "spec/**/*"
396
- Metrics/ParameterLists:
397
- Description: Avoid long parameter lists.
398
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
399
- Enabled: true
400
- Max: 5
401
- CountKeywordArgs: true
402
- Metrics/PerceivedComplexity:
403
- Description: A complexity metric geared towards measuring complexity for a human
404
- reader.
405
- Enabled: true
406
- Max: 7
407
- Lint/AssignmentInCondition:
408
- Description: Don't use assignment in conditions.
409
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
410
- Enabled: false
411
- AllowSafeAssignment: true
412
- Layout/EndAlignment:
413
- Description: Align ends correctly.
414
- Enabled: true
415
- EnforcedStyleAlignWith: keyword
416
- SupportedStylesAlignWith:
417
- - keyword
418
- - variable
419
- Layout/DefEndAlignment:
420
- Description: Align ends corresponding to defs correctly.
421
- Enabled: true
422
- EnforcedStyleAlignWith: start_of_line
423
- SupportedStylesAlignWith:
424
- - start_of_line
425
- - def
426
- Rails/ActionFilter:
427
- Description: Enforces consistent use of action filter methods.
428
- Enabled: true
429
- EnforcedStyle: action
430
- SupportedStyles:
431
- - action
432
- - filter
433
- Include:
434
- - app/controllers/**/*.rb
435
- Rails/HasAndBelongsToMany:
436
- Description: Prefer has_many :through to has_and_belongs_to_many.
437
- Enabled: true
438
- Include:
439
- - app/models/**/*.rb
440
- Rails/HttpPositionalArguments:
441
- Enabled: false
442
- Rails/Output:
443
- Description: Checks for calls to puts, print, etc.
444
- Enabled: true
445
- Include:
446
- - app/**/*.rb
447
- - config/**/*.rb
448
- - db/**/*.rb
449
- - lib/**/*.rb
450
- Rails/ReadWriteAttribute:
451
- Description: Checks for read_attribute(:attr) and write_attribute(:attr, val).
452
- Enabled: true
453
- Include:
454
- - app/models/**/*.rb
455
- Rails/ScopeArgs:
456
- Description: Checks the arguments of ActiveRecord scopes.
457
- Enabled: true
458
- Include:
459
- - app/models/**/*.rb
460
- Rails/Validation:
461
- Description: Use validates :attribute, hash of validations.
462
- Enabled: true
463
- Include:
464
- - app/models/**/*.rb
465
- Style/InlineComment:
466
- Description: Avoid inline comments.
467
- Enabled: false
468
- Style/MethodCalledOnDoEndBlock:
469
- Description: Avoid chaining a method call on a do...end block.
470
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
471
- Enabled: false
472
- Style/SymbolArray:
473
- Description: Use %i or %I for arrays of symbols.
474
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-i
475
- Enabled: false
476
- Style/Alias:
477
- Description: Use alias_method instead of alias.
478
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
479
- Enabled: false
480
- Style/ArrayJoin:
481
- Description: Use Array#join instead of Array#*.
482
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#array-join
483
- Enabled: false
484
- Style/AsciiComments:
485
- Description: Use only ascii symbols in comments.
486
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-comments
487
- Enabled: false
488
- Style/Attr:
489
- Description: Checks for uses of Module#attr.
490
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr
491
- Enabled: false
492
- Style/BeginBlock:
493
- Description: Avoid the use of BEGIN blocks.
494
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks
495
- Enabled: true
496
- Style/BlockComments:
497
- Description: Do not use block comments.
498
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-block-comments
499
- Enabled: true
500
- Style/BlockDelimiters:
501
- Description: Avoid using {...} for multi-line blocks (multiline chaining is always
502
- ugly). Prefer {...} over do...end for single-line blocks.
503
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
504
- Enabled: true
505
- Style/CaseEquality:
506
- Description: Avoid explicit use of the case equality operator(===).
507
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-case-equality
508
- Enabled: false
509
- Style/CharacterLiteral:
510
- Description: Checks for uses of character literals.
511
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-character-literals
512
- Enabled: false
513
- Style/ClassMethods:
514
- Description: Use self when defining module/class methods.
515
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#def-self-singletons
516
- Enabled: true
517
- Style/ClassVars:
518
- Description: Avoid the use of class variables.
519
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-class-vars
520
- Enabled: false
521
- Style/ColonMethodCall:
522
- Description: 'Do not use :: for method call.'
523
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#double-colons
524
- Enabled: false
525
- Style/DefWithParentheses:
526
- Description: Use def with parentheses when there are arguments.
527
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens
528
- Enabled: true
529
- Style/Documentation:
530
- Description: Document classes and non-namespace modules.
531
- Enabled: false
532
- Style/DoubleNegation:
533
- Description: Checks for uses of double negation (!!).
534
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
535
- Enabled: false
536
- Style/EachWithObject:
537
- Description: Prefer `each_with_object` over `inject` or `reduce`.
538
- Enabled: false
539
- Style/EmptyElse:
540
- Description: Avoid empty else-clauses.
541
- Enabled: true
542
- Style/EmptyLiteral:
543
- Description: Prefer literals to Array.new/Hash.new/String.new.
544
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
545
- Enabled: false
546
- Style/EndBlock:
547
- Description: Avoid the use of END blocks.
548
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-END-blocks
549
- Enabled: true
550
- Style/EvenOdd:
551
- Description: Favor the use of Fixnum#even? && Fixnum#odd?
552
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
553
- Enabled: false
554
- Style/IfWithSemicolon:
555
- Description: Do not use if x; .... Use the ternary operator instead.
556
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs
557
- Enabled: false
558
- Style/IfUnlessModifier:
559
- Description: Favor modifier if/unless usage when you have a single-line body.
560
- Enabled: false
561
- Style/InfiniteLoop:
562
- Description: Use Kernel#loop for infinite loops.
563
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#infinite-loop
564
- Enabled: true
565
- Style/Lambda:
566
- Description: Use the new lambda literal syntax for single-line blocks.
567
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#lambda-multi-line
568
- Enabled: false
569
- Style/LineEndConcatenation:
570
- Description: Use \ instead of + or << to concatenate two string literals at line
571
- end.
572
- Enabled: false
573
- Style/MethodCallWithoutArgsParentheses:
574
- Description: Do not use parentheses for method calls with no arguments.
575
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-args-no-parens
576
- Enabled: true
577
- Style/ModuleFunction:
578
- Description: Checks for usage of `extend self` in modules.
579
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
580
- Enabled: false
581
- Style/MultilineIfThen:
582
- Description: Do not use then for multi-line if/unless.
583
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-then
584
- Enabled: true
585
- Style/MultilineTernaryOperator:
586
- Description: 'Avoid multi-line ?: (the ternary operator); use if/unless instead.'
587
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary
588
- Enabled: true
589
- Style/NegatedIf:
590
- Description: Favor unless over if for negative conditions (or control flow or).
591
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#unless-for-negatives
592
- Enabled: false
593
- Style/NegatedWhile:
594
- Description: Favor until over while for negative conditions.
595
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#until-for-negatives
596
- Enabled: false
597
- Style/NestedTernaryOperator:
598
- Description: Use one expression per branch in a ternary operator.
599
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-ternary
600
- Enabled: true
601
- Style/NilComparison:
602
- Description: Prefer x.nil? to x == nil.
603
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
604
- Enabled: false
605
- Style/Not:
606
- Description: Use ! instead of not.
607
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#bang-not-not
608
- Enabled: false
609
- Style/OneLineConditional:
610
- Description: Favor the ternary operator(?:) over if/then/else/end constructs.
611
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
612
- Enabled: false
613
- Style/PerlBackrefs:
614
- Description: Avoid Perl-style regex back references.
615
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
616
- Enabled: false
617
- Style/PreferredHashMethods:
618
- Description: Checks for use of deprecated Hash methods.
619
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-key
620
- Enabled: false
621
- Style/Proc:
622
- Description: Use proc instead of Proc.new.
623
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc
624
- Enabled: false
625
- Style/RedundantBegin:
626
- Description: Don't use begin blocks when they are not needed.
627
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#begin-implicit
628
- Enabled: true
629
- Style/RedundantException:
630
- Description: Checks for an obsolete RuntimeException argument in raise/fail.
631
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror
632
- Enabled: true
633
- Style/RedundantSelf:
634
- Description: Don't use self where it's not needed.
635
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-self-unless-required
636
- Enabled: true
637
- Style/RescueModifier:
638
- Description: Avoid using rescue in its modifier form.
639
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers
640
- Enabled: true
641
- Style/SelfAssignment:
642
- Description: Checks for places where self-assignment shorthand should have been
643
- used.
644
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#self-assignment
645
- Enabled: false
646
- Style/SpecialGlobalVars:
647
- Description: Avoid Perl-style global variables.
648
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
649
- Enabled: false
650
- Style/StructInheritance:
651
- Description: Checks for inheritance from Struct.new.
652
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new
653
- Enabled: true
654
- Style/UnlessElse:
655
- Description: Do not use unless with else. Rewrite these with the positive case first.
656
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-else-with-unless
657
- Enabled: true
658
- Style/RedundantCapitalW:
659
- Description: Checks for %W when interpolation is not needed.
660
- Enabled: true
661
- Style/RedundantPercentQ:
662
- Description: Checks for %q/%Q when single quotes or double quotes would do.
663
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q
664
- Enabled: true
665
- Style/CommandLiteral:
666
- Description: Checks for %x when `` would do.
667
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-x
668
- Enabled: true
669
- Style/VariableInterpolation:
670
- Description: Don't interpolate global, instance and class variables directly in
671
- strings.
672
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
673
- Enabled: false
674
- Style/WhenThen:
675
- Description: Use when x then ... for one-line cases.
676
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
677
- Enabled: false
678
- Style/WhileUntilDo:
679
- Description: Checks for redundant do after while or until.
680
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do
681
- Enabled: true
682
- Layout/AccessModifierIndentation:
683
- Description: Check indentation of private/protected visibility modifiers.
684
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected
685
- Enabled: true
686
- EnforcedStyle: indent
687
- SupportedStyles:
688
- - outdent
689
- - indent
690
- Layout/HashAlignment:
691
- Description: Align the elements of a hash literal if they span more than one line.
692
- Enabled: true
693
- EnforcedHashRocketStyle: key
694
- EnforcedColonStyle: key
695
- EnforcedLastArgumentHashStyle: always_inspect
696
- SupportedLastArgumentHashStyles:
697
- - always_inspect
698
- - always_ignore
699
- - ignore_implicit
700
- - ignore_explicit
701
- Layout/ParameterAlignment:
702
- Description: Align the parameters of a method call if they span more than one line.
703
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-double-indent
704
- Enabled: true
705
- EnforcedStyle: with_first_parameter
706
- SupportedStyles:
707
- - with_first_parameter
708
- - with_fixed_indentation
709
- Layout/CaseIndentation:
710
- Description: Indentation of when in a case/when/[else/]end.
711
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-when-to-case
712
- Enabled: true
713
- EnforcedStyle: case
714
- SupportedStyles:
715
- - case
716
- - end
717
- IndentOneStep: false
718
- Layout/CommentIndentation:
719
- Description: Indentation of comments.
720
- Enabled: true
721
- Layout/DotPosition:
722
- Description: Checks the position of the dot in multi-line method calls.
723
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
724
- Enabled: true
725
- EnforcedStyle: trailing
726
- SupportedStyles:
727
- - leading
728
- - trailing
729
- Layout/EmptyLineBetweenDefs:
730
- Description: Use empty lines between defs.
731
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods
732
- Enabled: true
733
- AllowAdjacentOneLineDefs: false
734
- Layout/EmptyLinesAroundBlockBody:
735
- Description: Keeps track of empty lines around block bodies.
736
- Enabled: true
737
- EnforcedStyle: no_empty_lines
738
- SupportedStyles:
739
- - empty_lines
740
- - no_empty_lines
741
- Layout/EmptyLinesAroundClassBody:
742
- Description: Keeps track of empty lines around class bodies.
743
- Enabled: true
744
- EnforcedStyle: no_empty_lines
745
- SupportedStyles:
746
- - empty_lines
747
- - no_empty_lines
748
- Layout/EmptyLinesAroundModuleBody:
749
- Description: Keeps track of empty lines around module bodies.
750
- Enabled: true
751
- EnforcedStyle: no_empty_lines
752
- SupportedStyles:
753
- - empty_lines
754
- - no_empty_lines
755
- Layout/FirstArgumentIndentation:
756
- Description: Checks the indentation of the first parameter in a method call.
757
- Enabled: true
758
- EnforcedStyle: special_for_inner_method_call_in_parentheses
759
- SupportedStyles:
760
- - consistent
761
- - special_for_inner_method_call
762
- - special_for_inner_method_call_in_parentheses
763
- Layout/IndentationWidth:
764
- Description: Use 2 spaces for indentation.
765
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
766
- Enabled: true
767
- Width: 2
768
- Layout/FirstHashElementIndentation:
769
- Description: Checks the indentation of the first key in a hash literal.
770
- Enabled: true
771
- EnforcedStyle: special_inside_parentheses
772
- SupportedStyles:
773
- - special_inside_parentheses
774
- - consistent
775
- Layout/MultilineMethodCallIndentation:
776
- Description: Checks indentation of method calls with the dot operator
777
- that span more than one line.
778
- Enabled: true
779
- EnforcedStyle: indented
780
- SupportedStyles:
781
- - aligned
782
- - indented
783
- Layout/MultilineOperationIndentation:
784
- Description: Checks indentation of binary operations that span more than one line.
785
- Enabled: true
786
- EnforcedStyle: indented
787
- SupportedStyles:
788
- - aligned
789
- - indented
790
- Layout/SpaceAroundBlockParameters:
791
- Description: Checks the spacing inside and after block parameters pipes.
792
- Enabled: true
793
- EnforcedStyleInsidePipes: no_space
794
- SupportedStylesInsidePipes:
795
- - space
796
- - no_space
797
- Layout/SpaceAroundEqualsInParameterDefault:
798
- Description: Checks that the equals signs in parameter default assignments have
799
- or don't have surrounding space depending on configuration.
800
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-around-equals
801
- Enabled: true
802
- EnforcedStyle: space
803
- SupportedStyles:
804
- - space
805
- - no_space
806
- Layout/SpaceBeforeBlockBraces:
807
- Description: Checks that the left block brace has or doesn't have space before it.
808
- Enabled: true
809
- EnforcedStyle: space
810
- SupportedStyles:
811
- - space
812
- - no_space
813
- Layout/SpaceInsideBlockBraces:
814
- Description: Checks that block braces have or don't have surrounding space. For
815
- blocks taking parameters, checks that the left brace has or doesn't have trailing
816
- space.
817
- Enabled: true
818
- EnforcedStyle: space
819
- SupportedStyles:
820
- - space
821
- - no_space
822
- EnforcedStyleForEmptyBraces: no_space
823
- SpaceBeforeBlockParameters: true
824
- Layout/SpaceInsideArrayLiteralBrackets:
825
- Description: No spaces after [ or before ].
826
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
827
- Enabled: true
828
- Layout/SpaceInsideReferenceBrackets:
829
- Enabled: true
830
- Layout/SpaceInsideHashLiteralBraces:
831
- Description: Use spaces inside hash literal braces - or don't.
832
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
833
- Enabled: true
834
- EnforcedStyle: space
835
- EnforcedStyleForEmptyBraces: no_space
836
- SupportedStyles:
837
- - space
838
- - no_space
839
- Layout/TrailingEmptyLines:
840
- Description: Checks trailing blank lines and final newline.
841
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#newline-eof
842
- Enabled: true
843
- EnforcedStyle: final_newline
844
- SupportedStyles:
845
- - final_newline
846
- - final_blank_line
847
- Layout/ExtraSpacing:
848
- Description: Do not use unnecessary spacing.
849
- Enabled: true
850
- Layout/ArrayAlignment:
851
- Description: Align the elements of an array literal if they span more than one line.
852
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays
853
- Enabled: true
854
- Layout/BlockEndNewline:
855
- Description: Put end statement of multiline block on its own line.
856
- Enabled: true
857
- Layout/ElseAlignment:
858
- Description: Align elses and elsifs correctly.
859
- Enabled: true
860
- Layout/EmptyLines:
861
- Description: Don't use several empty lines in a row.
862
- Enabled: true
863
- Layout/EmptyLinesAroundAccessModifier:
864
- Description: Keep blank lines around access modifiers.
865
- Enabled: true
866
- Exclude:
867
- - "spec/factories.rb"
868
- Layout/EmptyLinesAroundMethodBody:
869
- Description: Keeps track of empty lines around method bodies.
870
- Enabled: true
871
- Layout/EndOfLine:
872
- Description: Use Unix-style line endings.
873
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#crlf
874
- Enabled: true
875
- Layout/IndentationConsistency:
876
- Description: Keep indentation straight.
877
- Enabled: true
878
- Layout/FirstArrayElementIndentation:
879
- Description: Checks the indentation of the first element in an array literal.
880
- Enabled: true
881
- Layout/LeadingCommentSpace:
882
- Description: Comments should start with a space.
883
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-space
884
- Enabled: true
885
- Layout/MultilineBlockLayout:
886
- Description: Ensures newlines after multiline block do statements.
887
- Enabled: true
888
- Layout/SpaceBeforeFirstArg:
889
- Description: Checks that exactly one space is used between a method name and the
890
- first argument for method calls without parentheses.
891
- Enabled: true
892
- Layout/SpaceAfterColon:
893
- Description: Use spaces after colons.
894
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
895
- Enabled: true
896
- Layout/SpaceAfterComma:
897
- Description: Use spaces after commas.
898
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
899
- Enabled: true
900
- Layout/SpaceAfterMethodName:
901
- Description: Do not put a space between a method name and the opening parenthesis
902
- in a method definition.
903
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
904
- Enabled: true
905
- Layout/SpaceAfterNot:
906
- Description: Tracks redundant space after the ! operator.
907
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-bang
908
- Enabled: true
909
- Layout/SpaceAfterSemicolon:
910
- Description: Use spaces after semicolons.
911
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
912
- Enabled: true
913
- Layout/SpaceBeforeComma:
914
- Description: No spaces before commas.
915
- Enabled: true
916
- Layout/SpaceBeforeComment:
917
- Description: Checks for missing space between code and a comment on the same line.
918
- Enabled: true
919
- Layout/SpaceBeforeSemicolon:
920
- Description: No spaces before semicolons.
921
- Enabled: true
922
- Layout/SpaceAroundOperators:
923
- Description: Use spaces around operators.
924
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
925
- Enabled: true
926
- Layout/SpaceAroundKeyword:
927
- Description: Put a space before the modifier keyword.
928
- Enabled: true
929
- Layout/SpaceInsideParens:
930
- Description: No spaces after ( or before ).
931
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
932
- Enabled: true
933
- Layout/SpaceInsideRangeLiteral:
934
- Description: No spaces inside range literals.
935
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals
936
- Enabled: true
937
- Layout/IndentationStyle:
938
- Description: No hard tabs.
939
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
940
- Enabled: true
941
- Layout/TrailingWhitespace:
942
- Description: Avoid trailing whitespace.
943
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace
944
- Enabled: true
945
- Lint/AmbiguousOperator:
946
- Description: Checks for ambiguous operators in the first argument of a method invocation
947
- without parentheses.
948
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-as-args
949
- Enabled: false
950
- Lint/AmbiguousRegexpLiteral:
951
- Description: Checks for ambiguous regexp literals in the first argument of a method
952
- invocation without parenthesis.
953
- Enabled: false
954
- Layout/BlockAlignment:
955
- Description: Align block ends correctly.
956
- Enabled: true
957
- Layout/ConditionPosition:
958
- Description: Checks for condition placed in a confusing position relative to the
959
- keyword.
960
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#same-line-condition
961
- Enabled: false
962
- Lint/Debugger:
963
- Description: Check for debugger calls.
964
- Enabled: true
965
- Lint/DeprecatedClassMethods:
966
- Description: Check for deprecated class method calls.
967
- Enabled: false
968
- Lint/DuplicateMethods:
969
- Description: Check for duplicate methods calls.
970
- Enabled: true
971
- Lint/ElseLayout:
972
- Description: Check for odd code arrangement in an else block.
973
- Enabled: false
974
- Lint/EmptyEnsure:
975
- Description: Checks for empty ensure block.
976
- Enabled: true
977
- Lint/EmptyInterpolation:
978
- Description: Checks for empty string interpolation.
979
- Enabled: true
980
- Lint/EnsureReturn:
981
- Description: Do not use return in an ensure block.
982
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-return-ensure
983
- Enabled: true
984
- Lint/FlipFlop:
985
- Description: Checks for flip flops
986
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-flip-flops
987
- Enabled: false
988
- Lint/SuppressedException:
989
- Description: Don't suppress exception.
990
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
991
- Enabled: false
992
- Lint/LiteralAsCondition:
993
- Description: Checks of literals used in conditions.
994
- Enabled: false
995
- Lint/LiteralInInterpolation:
996
- Description: Checks for literals used in interpolation.
997
- Enabled: false
998
- Lint/Loop:
999
- Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while
1000
- for post-loop tests.
1001
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#loop-with-break
1002
- Enabled: false
1003
- Lint/ParenthesesAsGroupedExpression:
1004
- Description: Checks for method calls with a space before the opening parenthesis.
1005
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
1006
- Enabled: false
1007
- Lint/RequireParentheses:
1008
- Description: Use parentheses in the method call to avoid confusion about precedence.
1009
- Enabled: false
1010
- Lint/RescueException:
1011
- Description: Avoid rescuing the Exception class.
1012
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-blind-rescues
1013
- Enabled: true
1014
- Lint/ShadowingOuterLocalVariable:
1015
- Description: Do not use the same name as outer local variable for block arguments
1016
- or block local variables.
1017
- Enabled: true
1018
- Lint/RedundantStringCoercion:
1019
- Description: Checks for Object#to_s usage in string interpolation.
1020
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-to-s
1021
- Enabled: true
1022
- Lint/UnderscorePrefixedVariableName:
1023
- Description: Do not use prefix `_` for a variable that is used.
1024
- Enabled: false
1025
- Lint/UnusedBlockArgument:
1026
- Description: Checks for unused block arguments.
1027
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
1028
- Enabled: true
1029
- Lint/UnusedMethodArgument:
1030
- Description: Checks for unused method arguments.
1031
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
1032
- Enabled: true
1033
- Lint/UnreachableCode:
1034
- Description: Unreachable code.
1035
- Enabled: true
1036
- Lint/UselessAccessModifier:
1037
- Description: Checks for useless access modifiers.
1038
- Enabled: true
1039
- Lint/UselessAssignment:
1040
- Description: Checks for useless assignment to a local variable.
1041
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
1042
- Enabled: true
1043
- Lint/BinaryOperatorWithIdenticalOperands:
1044
- Description: Checks for comparison of something with itself.
1045
- Enabled: true
1046
- Lint/UselessElseWithoutRescue:
1047
- Description: Checks for useless `else` in `begin..end` without `rescue`.
1048
- Enabled: true
1049
- Lint/UselessSetterCall:
1050
- Description: Checks for useless setter call to a local variable.
1051
- Enabled: true
1052
- Lint/Void:
1053
- Description: Possible use of operator/literal/variable in void context.
1054
- Enabled: false
1055
- Rails/Delegate:
1056
- Description: Prefer delegate method for delegations.
1057
- Enabled: false
1
+ rubocop:
2
+ config_file: .rubocop.yml
3
+ version: 1.22.1