paperclip 3.5.4 → 4.3.7
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of paperclip might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.gitignore +0 -6
- data/.hound.yml +1066 -0
- data/.rubocop.yml +1 -0
- data/.travis.yml +11 -17
- data/Appraisals +6 -14
- data/CONTRIBUTING.md +13 -8
- data/Gemfile +16 -3
- data/LICENSE +1 -3
- data/NEWS +167 -49
- data/README.md +294 -75
- data/RELEASING.md +17 -0
- data/Rakefile +6 -8
- data/features/basic_integration.feature +24 -6
- data/features/step_definitions/attachment_steps.rb +30 -22
- data/features/step_definitions/html_steps.rb +2 -2
- data/features/step_definitions/rails_steps.rb +44 -14
- data/features/step_definitions/web_steps.rb +1 -103
- data/features/support/env.rb +2 -2
- data/features/support/file_helpers.rb +2 -2
- data/features/support/fixtures/gemfile.txt +1 -1
- data/features/support/rails.rb +2 -1
- data/gemfiles/3.2.gemfile +14 -6
- data/gemfiles/4.1.gemfile +19 -0
- data/gemfiles/4.2.gemfile +19 -0
- data/lib/generators/paperclip/paperclip_generator.rb +0 -2
- data/lib/generators/paperclip/templates/paperclip_migration.rb.erb +1 -1
- data/lib/paperclip/attachment.rb +132 -38
- data/lib/paperclip/attachment_registry.rb +1 -1
- data/lib/paperclip/callbacks.rb +11 -1
- data/lib/paperclip/content_type_detector.rb +25 -22
- data/lib/paperclip/deprecations.rb +42 -0
- data/lib/paperclip/errors.rb +5 -0
- data/lib/paperclip/file_command_content_type_detector.rb +6 -8
- data/lib/paperclip/geometry_detector_factory.rb +3 -1
- data/lib/paperclip/geometry_parser_factory.rb +1 -1
- data/lib/paperclip/has_attached_file.rb +10 -0
- data/lib/paperclip/interpolations/plural_cache.rb +6 -5
- data/lib/paperclip/interpolations.rb +25 -12
- data/lib/paperclip/io_adapters/abstract_adapter.rb +3 -1
- data/lib/paperclip/io_adapters/attachment_adapter.rb +4 -4
- data/lib/paperclip/io_adapters/data_uri_adapter.rb +5 -10
- data/lib/paperclip/io_adapters/stringio_adapter.rb +6 -10
- data/lib/paperclip/io_adapters/uri_adapter.rb +30 -11
- data/lib/paperclip/locales/de.yml +18 -0
- data/lib/paperclip/locales/en.yml +1 -0
- data/lib/paperclip/locales/es.yml +18 -0
- data/lib/paperclip/locales/ja.yml +18 -0
- data/lib/paperclip/locales/pt-BR.yml +18 -0
- data/lib/paperclip/locales/zh-CN.yml +18 -0
- data/lib/paperclip/locales/zh-HK.yml +18 -0
- data/lib/paperclip/locales/zh-TW.yml +18 -0
- data/lib/paperclip/matchers/have_attached_file_matcher.rb +2 -1
- data/lib/paperclip/matchers/validate_attachment_presence_matcher.rb +2 -1
- data/lib/paperclip/matchers/validate_attachment_size_matcher.rb +2 -1
- data/lib/paperclip/media_type_spoof_detector.rb +89 -0
- data/lib/paperclip/processor.rb +0 -37
- data/lib/paperclip/processor_helpers.rb +50 -0
- data/lib/paperclip/rails_environment.rb +25 -0
- data/lib/paperclip/schema.rb +10 -2
- data/lib/paperclip/storage/filesystem.rb +1 -1
- data/lib/paperclip/storage/fog.rb +18 -7
- data/lib/paperclip/storage/s3.rb +53 -22
- data/lib/paperclip/style.rb +8 -2
- data/lib/paperclip/tempfile_factory.rb +5 -1
- data/lib/paperclip/thumbnail.rb +12 -10
- data/lib/paperclip/url_generator.rb +11 -3
- data/lib/paperclip/validators/attachment_content_type_validator.rb +4 -0
- data/lib/paperclip/validators/attachment_file_name_validator.rb +80 -0
- data/lib/paperclip/validators/attachment_file_type_ignorance_validator.rb +29 -0
- data/lib/paperclip/validators/attachment_presence_validator.rb +4 -0
- data/lib/paperclip/validators/attachment_size_validator.rb +11 -3
- data/lib/paperclip/validators/media_type_spoof_detection_validator.rb +27 -0
- data/lib/paperclip/validators.rb +10 -3
- data/lib/paperclip/version.rb +1 -1
- data/lib/paperclip.rb +26 -8
- data/lib/tasks/paperclip.rake +17 -2
- data/paperclip.gemspec +16 -14
- data/shoulda_macros/paperclip.rb +0 -1
- data/spec/paperclip/attachment_definitions_spec.rb +13 -0
- data/{test/attachment_processing_test.rb → spec/paperclip/attachment_processing_spec.rb} +20 -21
- data/spec/paperclip/attachment_registry_spec.rb +130 -0
- data/{test/attachment_test.rb → spec/paperclip/attachment_spec.rb} +438 -397
- data/{test/content_type_detector_test.rb → spec/paperclip/content_type_detector_spec.rb} +16 -19
- data/spec/paperclip/deprecations_spec.rb +65 -0
- data/{test/file_command_content_type_detector_test.rb → spec/paperclip/file_command_content_type_detector_spec.rb} +5 -6
- data/spec/paperclip/filename_cleaner_spec.rb +14 -0
- data/spec/paperclip/geometry_detector_spec.rb +39 -0
- data/{test/geometry_parser_test.rb → spec/paperclip/geometry_parser_spec.rb} +27 -27
- data/{test/geometry_test.rb → spec/paperclip/geometry_spec.rb} +50 -52
- data/spec/paperclip/glue_spec.rb +44 -0
- data/{test/has_attached_file_test.rb → spec/paperclip/has_attached_file_spec.rb} +45 -28
- data/{test/integration_test.rb → spec/paperclip/integration_spec.rb} +134 -126
- data/{test/interpolations_test.rb → spec/paperclip/interpolations_spec.rb} +70 -46
- data/spec/paperclip/io_adapters/abstract_adapter_spec.rb +78 -0
- data/{test/io_adapters/attachment_adapter_test.rb → spec/paperclip/io_adapters/attachment_adapter_spec.rb} +27 -29
- data/{test/io_adapters/data_uri_adapter_test.rb → spec/paperclip/io_adapters/data_uri_adapter_spec.rb} +26 -17
- data/spec/paperclip/io_adapters/empty_string_adapter_spec.rb +17 -0
- data/{test/io_adapters/file_adapter_test.rb → spec/paperclip/io_adapters/file_adapter_spec.rb} +36 -40
- data/{test/io_adapters/http_url_proxy_adapter_test.rb → spec/paperclip/io_adapters/http_url_proxy_adapter_spec.rb} +31 -29
- data/spec/paperclip/io_adapters/identity_adapter_spec.rb +8 -0
- data/{test/io_adapters/nil_adapter_test.rb → spec/paperclip/io_adapters/nil_adapter_spec.rb} +7 -7
- data/{test/io_adapters/registry_test.rb → spec/paperclip/io_adapters/registry_spec.rb} +10 -7
- data/{test/io_adapters/stringio_adapter_test.rb → spec/paperclip/io_adapters/stringio_adapter_spec.rb} +20 -17
- data/{test/io_adapters/uploaded_file_adapter_test.rb → spec/paperclip/io_adapters/uploaded_file_adapter_spec.rb} +41 -41
- data/{test/io_adapters/uri_adapter_test.rb → spec/paperclip/io_adapters/uri_adapter_spec.rb} +53 -28
- data/spec/paperclip/matchers/have_attached_file_matcher_spec.rb +19 -0
- data/spec/paperclip/matchers/validate_attachment_content_type_matcher_spec.rb +99 -0
- data/spec/paperclip/matchers/validate_attachment_presence_matcher_spec.rb +69 -0
- data/spec/paperclip/matchers/validate_attachment_size_matcher_spec.rb +88 -0
- data/spec/paperclip/media_type_spoof_detector_spec.rb +79 -0
- data/spec/paperclip/meta_class_spec.rb +30 -0
- data/spec/paperclip/paperclip_missing_attachment_styles_spec.rb +84 -0
- data/{test/paperclip_test.rb → spec/paperclip/paperclip_spec.rb} +53 -48
- data/spec/paperclip/plural_cache_spec.rb +37 -0
- data/spec/paperclip/processor_helpers_spec.rb +57 -0
- data/{test/processor_test.rb → spec/paperclip/processor_spec.rb} +5 -5
- data/spec/paperclip/rails_environment_spec.rb +33 -0
- data/{test/rake_test.rb → spec/paperclip/rake_spec.rb} +15 -15
- data/spec/paperclip/schema_spec.rb +248 -0
- data/{test/storage/filesystem_test.rb → spec/paperclip/storage/filesystem_spec.rb} +18 -18
- data/spec/paperclip/storage/fog_spec.rb +535 -0
- data/spec/paperclip/storage/s3_live_spec.rb +182 -0
- data/spec/paperclip/storage/s3_spec.rb +1526 -0
- data/spec/paperclip/style_spec.rb +255 -0
- data/spec/paperclip/tempfile_factory_spec.rb +33 -0
- data/{test/thumbnail_test.rb → spec/paperclip/thumbnail_spec.rb} +123 -107
- data/spec/paperclip/url_generator_spec.rb +211 -0
- data/spec/paperclip/validators/attachment_content_type_validator_spec.rb +322 -0
- data/spec/paperclip/validators/attachment_file_name_validator_spec.rb +160 -0
- data/{test/validators/attachment_presence_validator_test.rb → spec/paperclip/validators/attachment_presence_validator_spec.rb} +20 -20
- data/{test/validators/attachment_size_validator_test.rb → spec/paperclip/validators/attachment_size_validator_spec.rb} +65 -58
- data/spec/paperclip/validators/media_type_spoof_detection_validator_spec.rb +52 -0
- data/spec/paperclip/validators_spec.rb +164 -0
- data/spec/spec_helper.rb +43 -0
- data/spec/support/assertions.rb +71 -0
- data/spec/support/deprecations.rb +9 -0
- data/spec/support/fake_model.rb +25 -0
- data/spec/support/fake_rails.rb +12 -0
- data/spec/support/fixtures/empty.html +1 -0
- data/spec/support/fixtures/empty.xlsx +0 -0
- data/spec/support/fixtures/spaced file.jpg +0 -0
- data/spec/support/matchers/accept.rb +5 -0
- data/spec/support/matchers/exist.rb +5 -0
- data/spec/support/matchers/have_column.rb +23 -0
- data/spec/support/model_reconstruction.rb +60 -0
- data/spec/support/rails_helpers.rb +7 -0
- data/spec/support/test_data.rb +13 -0
- data/spec/support/version_helper.rb +9 -0
- metadata +334 -219
- data/RUNNING_TESTS.md +0 -4
- data/gemfiles/3.0.gemfile +0 -11
- data/gemfiles/3.1.gemfile +0 -11
- data/gemfiles/4.0.gemfile +0 -11
- data/test/attachment_definitions_test.rb +0 -12
- data/test/attachment_registry_test.rb +0 -88
- data/test/filename_cleaner_test.rb +0 -14
- data/test/generator_test.rb +0 -84
- data/test/geometry_detector_test.rb +0 -24
- data/test/helper.rb +0 -232
- data/test/io_adapters/abstract_adapter_test.rb +0 -58
- data/test/io_adapters/empty_string_adapter_test.rb +0 -18
- data/test/io_adapters/identity_adapter_test.rb +0 -8
- data/test/matchers/have_attached_file_matcher_test.rb +0 -24
- data/test/matchers/validate_attachment_content_type_matcher_test.rb +0 -110
- data/test/matchers/validate_attachment_presence_matcher_test.rb +0 -69
- data/test/matchers/validate_attachment_size_matcher_test.rb +0 -86
- data/test/meta_class_test.rb +0 -32
- data/test/paperclip_missing_attachment_styles_test.rb +0 -90
- data/test/plural_cache_test.rb +0 -36
- data/test/schema_test.rb +0 -200
- data/test/storage/fog_test.rb +0 -473
- data/test/storage/s3_live_test.rb +0 -179
- data/test/storage/s3_test.rb +0 -1356
- data/test/style_test.rb +0 -213
- data/test/support/mock_model.rb +0 -2
- data/test/tempfile_factory_test.rb +0 -17
- data/test/url_generator_test.rb +0 -187
- data/test/validators/attachment_content_type_validator_test.rb +0 -324
- data/test/validators_test.rb +0 -61
- /data/{test → spec}/database.yml +0 -0
- /data/{test → spec/support}/fixtures/12k.png +0 -0
- /data/{test → spec/support}/fixtures/50x50.png +0 -0
- /data/{test → spec/support}/fixtures/5k.png +0 -0
- /data/{test → spec/support}/fixtures/animated +0 -0
- /data/{test → spec/support}/fixtures/animated.gif +0 -0
- /data/{test → spec/support}/fixtures/animated.unknown +0 -0
- /data/{test → spec/support}/fixtures/bad.png +0 -0
- /data/{test → spec/support}/fixtures/fog.yml +0 -0
- /data/{test → spec/support}/fixtures/rotated.jpg +0 -0
- /data/{test → spec/support}/fixtures/s3.yml +0 -0
- /data/{test → spec/support}/fixtures/spaced file.png +0 -0
- /data/{test → spec/support}/fixtures/text.txt +0 -0
- /data/{test → spec/support}/fixtures/twopage.pdf +0 -0
- /data/{test → spec/support}/fixtures/uppercase.PNG +0 -0
- /data/{test → spec}/support/mock_attachment.rb +0 -0
- /data/{test → spec}/support/mock_interpolator.rb +0 -0
- /data/{test → spec}/support/mock_url_generator_builder.rb +0 -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/UselessComparison:
|
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
|
+
|