jr-paperclip 7.3.0

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