kt-paperclip 4.4.0

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