paperclip 4.2.4 → 5.2.0

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