kt-paperclip 6.2.0 → 7.1.1

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