cookstyle 5.23.0 → 6.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/config/cookstyle.yml +86 -4
- data/config/disable_all.yml +58 -52
- data/config/upstream.yml +377 -336
- data/lib/cookstyle.rb +0 -1
- data/lib/cookstyle/version.rb +2 -2
- data/lib/rubocop/chef/cookbook_helpers.rb +3 -3
- data/lib/rubocop/cop/chef/correctness/chef_application_fatal.rb +58 -0
- data/lib/rubocop/cop/chef/correctness/incorrect_library_injection.rb +11 -5
- data/lib/rubocop/cop/chef/correctness/powershell_delete_file.rb +53 -0
- data/lib/rubocop/cop/chef/deprecation/chef_handler_supports.rb +3 -3
- data/lib/rubocop/cop/chef/deprecation/chef_rest.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/chef_rewind.rb +4 -4
- data/lib/rubocop/cop/chef/deprecation/chef_windows_platform_helper.rb +56 -0
- data/lib/rubocop/cop/chef/deprecation/cheffile.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chefspec_coverage_report.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chefspec_legacy_runner.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chocolatey_package_uninstall_action.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/depends_compat_resource.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/depends_partial_search.rb +1 -5
- data/lib/rubocop/cop/chef/deprecation/depends_poise.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_chefspec_platform.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_mixins.rb +3 -3
- data/lib/rubocop/cop/chef/deprecation/deprecated_platform_methods.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_windows_version_check.rb +40 -0
- data/lib/rubocop/cop/chef/deprecation/deprecated_yum_repository_properties.rb +1 -4
- data/lib/rubocop/cop/chef/deprecation/easy_install.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/eol_audit_mode.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/epic_fail.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/erl_call.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/inherits_compat_resource.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/launchd_deprecated_hash_property.rb +1 -4
- data/lib/rubocop/cop/chef/deprecation/legacy_notify_syntax.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/legacy_yum_cookbook_recipes.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/locale_lc_all_property.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/log_resource_notifications.rb +60 -0
- data/lib/rubocop/cop/chef/deprecation/name_property_and_default.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/node_deep_fetch.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/node_methods_not_attributes.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/node_set.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/node_set_unless.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/node_set_without_level.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/partial_search_class_usage.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/partial_search_helper_usage.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/poise_archive.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/require_recipe.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/resource_overrides_provides_method.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/resource_uses_dsl_name_method.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/resource_uses_provider_base_method.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/resource_uses_updated_method.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/resource_without_name_or_provides.rb +81 -0
- data/lib/rubocop/cop/chef/deprecation/ruby_block_create_action.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/run_command_helper.rb +3 -3
- data/lib/rubocop/cop/chef/deprecation/search_uses_positional_parameters.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/use_inline_resources.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/user_supports_property.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/verify_property_file_expansion.rb +1 -4
- data/lib/rubocop/cop/chef/deprecation/windows_feature_servermanagercmd.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/windows_task_change_action.rb +1 -4
- data/lib/rubocop/cop/chef/deprecation/xml_ruby_recipe.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/yum_dnf_compat_recipe.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/databag_helpers.rb +58 -0
- data/lib/rubocop/cop/chef/modernize/powershell_guard_interpreter.rb +17 -8
- data/lib/rubocop/cop/chef/modernize/powershell_install_windowsfeature.rb +3 -3
- data/lib/rubocop/cop/chef/modernize/provides_initializer.rb +69 -0
- data/lib/rubocop/cop/chef/modernize/respond_to_provides.rb +5 -15
- data/lib/rubocop/cop/chef/modernize/use_multipackage_installs.rb +103 -0
- data/lib/rubocop/cop/chef/modernize/whyrun_supported_true.rb +2 -9
- data/lib/rubocop/cop/chef/modernize/windows_registry_uac.rb +2 -2
- data/lib/rubocop/cop/chef/redundant/apt_repository_distribution_default.rb +0 -1
- data/lib/rubocop/cop/chef/redundant/sensitive_property_in_resource.rb +3 -3
- data/lib/rubocop/monkey_patches/comment_config.rb +1 -1
- data/lib/rubocop/monkey_patches/config.rb +1 -1
- metadata +13 -5
- data/lib/rubocop/monkey_patches/json_formatter.rb +0 -20
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8630cadf214ce92de0f6c69de2951015e6930943b7fe4e987a0ac5ab0191d73e
|
|
4
|
+
data.tar.gz: 4aa39f4879f6eb93bf2ff9cd7922e471eb366d62992474ced13c7f9ac27e0108
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7a5aedf9341dd80db77974b72c8e4a07f1aeb2a583764f9d7232ee57860c1e5e3433eb0dcecaadaf45abfc2256d9ca64f220a74747feeb90458931c7a6ca0846
|
|
7
|
+
data.tar.gz: 292a4016ac850e050005a7b2f686d8d6c41201372ccb747457cd74eab46ccbbc60f4eac7ed70576829578509a996e58e987f7b4e1c6b9bd49aebac314c60ed4f
|
data/config/cookstyle.yml
CHANGED
|
@@ -324,6 +324,23 @@ ChefCorrectness/DnfPackageAllowDowngrades:
|
|
|
324
324
|
- '**/metadata.rb'
|
|
325
325
|
- '**/Berksfile'
|
|
326
326
|
|
|
327
|
+
ChefCorrectness/ChefApplicationFatal:
|
|
328
|
+
Description: Use raise to force Chef Infra Client to fail instead of using Chef::Application.fatal
|
|
329
|
+
Enabled: true
|
|
330
|
+
VersionAdded: '6.0.0'
|
|
331
|
+
Exclude:
|
|
332
|
+
- '**/metadata.rb'
|
|
333
|
+
- '**/Berksfile'
|
|
334
|
+
|
|
335
|
+
ChefCorrectness/PowershellScriptDeleteFile:
|
|
336
|
+
Description: Use the `file` or `directory` resources built into Chef Infra Client with the :delete action to remove files/directories instead of using Remove-Item in a powershell_script resource
|
|
337
|
+
Enabled: true
|
|
338
|
+
VersionAdded: '6.0.0'
|
|
339
|
+
Exclude:
|
|
340
|
+
- '**/attributes/*.rb'
|
|
341
|
+
- '**/metadata.rb'
|
|
342
|
+
- '**/Berksfile'
|
|
343
|
+
|
|
327
344
|
###############################
|
|
328
345
|
# ChefSharing: Issues that prevent sharing code with other teams or with the Chef community in general
|
|
329
346
|
###############################
|
|
@@ -726,6 +743,37 @@ ChefDeprecations/WindowsFeatureServermanagercmd:
|
|
|
726
743
|
- '**/attributes/*.rb'
|
|
727
744
|
- '**/Berksfile'
|
|
728
745
|
|
|
746
|
+
ChefDeprecations/DeprecatedWindowsVersionCheck:
|
|
747
|
+
Description: Don't use the deprecated older_than_win_2012_or_8? helper. Windows versions before 2012 and 8 are now end of life and this helper will always return false.
|
|
748
|
+
Enabled: true
|
|
749
|
+
VersionAdded: '6.0.0'
|
|
750
|
+
Exclude:
|
|
751
|
+
- '**/metadata.rb'
|
|
752
|
+
- '**/Berksfile'
|
|
753
|
+
|
|
754
|
+
ChefDeprecations/ChefWindowsPlatformHelper:
|
|
755
|
+
Description: Use `platform?('windows')` instead of the legacy `Chef::Platform.windows?` helper.
|
|
756
|
+
Enabled: true
|
|
757
|
+
VersionAdded: '6.0.0'
|
|
758
|
+
Exclude:
|
|
759
|
+
- '**/metadata.rb'
|
|
760
|
+
- '**/Berksfile'
|
|
761
|
+
|
|
762
|
+
ChefDeprecations/LogResourceNotifications:
|
|
763
|
+
Description: In Chef Infra Client 16 the log resource no longer notifies when logging so notifications should not be triggered from log resources. Use the notify_group resource instead to aggregate notifications.
|
|
764
|
+
Enabled: true
|
|
765
|
+
VersionAdded: '6.0.0'
|
|
766
|
+
Exclude:
|
|
767
|
+
- '**/metadata.rb'
|
|
768
|
+
- '**/Berksfile'
|
|
769
|
+
|
|
770
|
+
ChefDeprecations/ResourceWithoutNameOrProvides:
|
|
771
|
+
Description: In Chef Infra Client 16 and later legacy HWRP resources must use either `resource_name` or `provides` to define the resource name.
|
|
772
|
+
Enabled: true
|
|
773
|
+
VersionAdded: '6.0.0'
|
|
774
|
+
Include:
|
|
775
|
+
- '**/libraries/*.rb'
|
|
776
|
+
|
|
729
777
|
###############################
|
|
730
778
|
# ChefModernize: Cleaning up legacy code and using new built-in resources
|
|
731
779
|
###############################
|
|
@@ -1150,6 +1198,32 @@ ChefModernize/WindowsRegistryUAC:
|
|
|
1150
1198
|
- '**/attributes/*.rb'
|
|
1151
1199
|
- '**/Berksfile'
|
|
1152
1200
|
|
|
1201
|
+
ChefModernize/UseMultipackageInstalls:
|
|
1202
|
+
Description: Pass an array of packages to package resources instead of interating over an array of packages when using multi-package capable package subystem such as apt, yum, chocolatey, dnf, or zypper. Multipackage installs are faster and simplify logs.
|
|
1203
|
+
Enabled: true
|
|
1204
|
+
VersionAdded: '6.0.0'
|
|
1205
|
+
Exclude:
|
|
1206
|
+
- '**/metadata.rb'
|
|
1207
|
+
- '**/attributes/*.rb'
|
|
1208
|
+
- '**/Berksfile'
|
|
1209
|
+
|
|
1210
|
+
ChefModernize/ProvidesFromInitialize:
|
|
1211
|
+
Description: Provides should be set using the `provides` resource DSL method instead of instead of setting @provides in the initialize method.
|
|
1212
|
+
Enabled: true
|
|
1213
|
+
VersionAdded: '6.0.0'
|
|
1214
|
+
Include:
|
|
1215
|
+
- '**/resources/*.rb'
|
|
1216
|
+
- '**/providers/*.rb'
|
|
1217
|
+
- '**/libraries/*.rb'
|
|
1218
|
+
|
|
1219
|
+
ChefModernize/DatabagHelpers:
|
|
1220
|
+
Description: Use the `data_bag_item` helper instead of `Chef::DataBagItem.load` or `Chef::EncryptedDataBagItem.load`.
|
|
1221
|
+
Enabled: true
|
|
1222
|
+
VersionAdded: '6.0.0'
|
|
1223
|
+
Exclude:
|
|
1224
|
+
- '**/metadata.rb'
|
|
1225
|
+
- '**/Berksfile'
|
|
1226
|
+
|
|
1153
1227
|
###############################
|
|
1154
1228
|
# ChefRedundantCode: Cleanup unnecessary code in your cookbooks regardless of Chef Infra Client release
|
|
1155
1229
|
###############################
|
|
@@ -1784,7 +1858,7 @@ Naming/FileName:
|
|
|
1784
1858
|
Enabled: false
|
|
1785
1859
|
|
|
1786
1860
|
# disable all the length cops as they're not appropriate for cookbooks
|
|
1787
|
-
|
|
1861
|
+
Layout/LineLength:
|
|
1788
1862
|
Enabled: false
|
|
1789
1863
|
Metrics/MethodLength:
|
|
1790
1864
|
Enabled: false
|
|
@@ -1805,8 +1879,8 @@ Metrics/PerceivedComplexity:
|
|
|
1805
1879
|
|
|
1806
1880
|
# This updates how we send helpers into the Chef recipe/resource classes and makes WAY more sense
|
|
1807
1881
|
# Chef::Recipe.send(:include, ::Apt::Helpers) -> Chef::Recipe.include ::Apt::Helpers
|
|
1808
|
-
|
|
1809
|
-
|
|
1882
|
+
Lint/SendWithMixinArgument:
|
|
1883
|
+
Enabled: true
|
|
1810
1884
|
|
|
1811
1885
|
#### END COPS FOR THE NEXT MAJOR RELEASE
|
|
1812
1886
|
|
|
@@ -2021,4 +2095,12 @@ Bundler/OrderedGems:
|
|
|
2021
2095
|
# extend self and module_function are not the same. module_function makes all the methods private
|
|
2022
2096
|
# and this rule will break any library that worked with extend self.
|
|
2023
2097
|
Style/ModuleFunction:
|
|
2024
|
-
Enabled: false
|
|
2098
|
+
Enabled: false
|
|
2099
|
+
|
|
2100
|
+
# Avoid using extra then statements in a multiline case
|
|
2101
|
+
Style/MultilineWhenThen:
|
|
2102
|
+
Enabled: true
|
|
2103
|
+
|
|
2104
|
+
# .each_key is a lot more clear that .keys.each
|
|
2105
|
+
Style/HashEachMethods:
|
|
2106
|
+
Enabled: true
|
data/config/disable_all.yml
CHANGED
|
@@ -19,13 +19,11 @@ Gemspec/RubyVersionGlobalsUsage:
|
|
|
19
19
|
Enabled: false
|
|
20
20
|
Layout/AccessModifierIndentation:
|
|
21
21
|
Enabled: false
|
|
22
|
-
Layout/
|
|
22
|
+
Layout/ArgumentAlignment:
|
|
23
23
|
Enabled: false
|
|
24
|
-
Layout/
|
|
24
|
+
Layout/ArrayAlignment:
|
|
25
25
|
Enabled: false
|
|
26
|
-
Layout/
|
|
27
|
-
Enabled: false
|
|
28
|
-
Layout/AlignParameters:
|
|
26
|
+
Layout/AssignmentIndentation:
|
|
29
27
|
Enabled: false
|
|
30
28
|
Layout/BlockAlignment:
|
|
31
29
|
Enabled: false
|
|
@@ -81,38 +79,40 @@ Layout/EndOfLine:
|
|
|
81
79
|
Enabled: false
|
|
82
80
|
Layout/ExtraSpacing:
|
|
83
81
|
Enabled: false
|
|
82
|
+
Layout/FirstArgumentIndentation:
|
|
83
|
+
Enabled: false
|
|
84
|
+
Layout/FirstArrayElementIndentation:
|
|
85
|
+
Enabled: false
|
|
84
86
|
Layout/FirstArrayElementLineBreak:
|
|
85
87
|
Enabled: false
|
|
88
|
+
Layout/FirstHashElementIndentation:
|
|
89
|
+
Enabled: false
|
|
86
90
|
Layout/FirstHashElementLineBreak:
|
|
87
91
|
Enabled: false
|
|
88
92
|
Layout/FirstMethodArgumentLineBreak:
|
|
89
93
|
Enabled: false
|
|
90
94
|
Layout/FirstMethodParameterLineBreak:
|
|
91
95
|
Enabled: false
|
|
96
|
+
Layout/FirstParameterIndentation:
|
|
97
|
+
Enabled: false
|
|
98
|
+
Layout/HashAlignment:
|
|
99
|
+
Enabled: false
|
|
92
100
|
Layout/HeredocArgumentClosingParenthesis:
|
|
93
101
|
Enabled: false
|
|
94
|
-
Layout/
|
|
102
|
+
Layout/HeredocIndentation:
|
|
95
103
|
Enabled: false
|
|
96
104
|
Layout/IndentationConsistency:
|
|
97
105
|
Enabled: false
|
|
98
106
|
Layout/IndentationWidth:
|
|
99
107
|
Enabled: false
|
|
100
|
-
Layout/IndentFirstArgument:
|
|
101
|
-
Enabled: false
|
|
102
|
-
Layout/IndentFirstArrayElement:
|
|
103
|
-
Enabled: false
|
|
104
|
-
Layout/IndentFirstHashElement:
|
|
105
|
-
Enabled: false
|
|
106
|
-
Layout/IndentFirstParameter:
|
|
107
|
-
Enabled: false
|
|
108
|
-
Layout/IndentHeredoc:
|
|
109
|
-
Enabled: false
|
|
110
108
|
Layout/InitialIndentation:
|
|
111
109
|
Enabled: false
|
|
112
|
-
Layout/LeadingBlankLines:
|
|
113
|
-
Enabled: false
|
|
114
110
|
Layout/LeadingCommentSpace:
|
|
115
111
|
Enabled: false
|
|
112
|
+
Layout/LeadingEmptyLines:
|
|
113
|
+
Enabled: false
|
|
114
|
+
Layout/LineLength:
|
|
115
|
+
Enabled: false
|
|
116
116
|
Layout/MultilineArrayBraceLayout:
|
|
117
117
|
Enabled: false
|
|
118
118
|
Layout/MultilineArrayLineBreaks:
|
|
@@ -135,6 +135,8 @@ Layout/MultilineMethodDefinitionBraceLayout:
|
|
|
135
135
|
Enabled: false
|
|
136
136
|
Layout/MultilineOperationIndentation:
|
|
137
137
|
Enabled: false
|
|
138
|
+
Layout/ParameterAlignment:
|
|
139
|
+
Enabled: false
|
|
138
140
|
Layout/RescueEnsureAlignment:
|
|
139
141
|
Enabled: false
|
|
140
142
|
Layout/SpaceAfterColon:
|
|
@@ -187,7 +189,7 @@ Layout/SpaceInsideStringInterpolation:
|
|
|
187
189
|
Enabled: false
|
|
188
190
|
Layout/Tab:
|
|
189
191
|
Enabled: false
|
|
190
|
-
Layout/
|
|
192
|
+
Layout/TrailingEmptyLines:
|
|
191
193
|
Enabled: false
|
|
192
194
|
Layout/TrailingWhitespace:
|
|
193
195
|
Enabled: false
|
|
@@ -213,9 +215,9 @@ Lint/DisjunctiveAssignmentInConstructor:
|
|
|
213
215
|
Enabled: false
|
|
214
216
|
Lint/DuplicateCaseCondition:
|
|
215
217
|
Enabled: false
|
|
216
|
-
Lint/
|
|
218
|
+
Lint/DuplicateHashKey:
|
|
217
219
|
Enabled: false
|
|
218
|
-
Lint/
|
|
220
|
+
Lint/DuplicateMethods:
|
|
219
221
|
Enabled: false
|
|
220
222
|
Lint/EachWithObjectArgument:
|
|
221
223
|
Enabled: false
|
|
@@ -241,8 +243,6 @@ Lint/FloatOutOfRange:
|
|
|
241
243
|
Enabled: false
|
|
242
244
|
Lint/FormatParameterMismatch:
|
|
243
245
|
Enabled: false
|
|
244
|
-
Lint/HandleExceptions:
|
|
245
|
-
Enabled: false
|
|
246
246
|
Lint/HeredocMethodCallPosition:
|
|
247
247
|
Enabled: false
|
|
248
248
|
Lint/ImplicitStringConcatenation:
|
|
@@ -261,7 +261,7 @@ Lint/Loop:
|
|
|
261
261
|
Enabled: false
|
|
262
262
|
Lint/MissingCopEnableDirective:
|
|
263
263
|
Enabled: false
|
|
264
|
-
Lint/
|
|
264
|
+
Lint/MultipleComparison:
|
|
265
265
|
Enabled: false
|
|
266
266
|
Lint/NestedMethodDefinition:
|
|
267
267
|
Enabled: false
|
|
@@ -269,6 +269,8 @@ Lint/NestedPercentLiteral:
|
|
|
269
269
|
Enabled: false
|
|
270
270
|
Lint/NextWithoutAccumulator:
|
|
271
271
|
Enabled: false
|
|
272
|
+
Lint/NonDeterministicRequireOrder:
|
|
273
|
+
Enabled: false
|
|
272
274
|
Lint/NonLocalExitFromIterator:
|
|
273
275
|
Enabled: false
|
|
274
276
|
Lint/NumberConversion:
|
|
@@ -283,6 +285,16 @@ Lint/PercentSymbolArray:
|
|
|
283
285
|
Enabled: false
|
|
284
286
|
Lint/RandOne:
|
|
285
287
|
Enabled: false
|
|
288
|
+
Lint/RedundantCopDisableDirective:
|
|
289
|
+
Enabled: false
|
|
290
|
+
Lint/RedundantCopEnableDirective:
|
|
291
|
+
Enabled: false
|
|
292
|
+
Lint/RedundantRequireStatement:
|
|
293
|
+
Enabled: false
|
|
294
|
+
Lint/RedundantSplatExpansion:
|
|
295
|
+
Enabled: false
|
|
296
|
+
Lint/RedundantStringCoercion:
|
|
297
|
+
Enabled: false
|
|
286
298
|
Lint/RedundantWithIndex:
|
|
287
299
|
Enabled: false
|
|
288
300
|
Lint/RedundantWithObject:
|
|
@@ -313,7 +325,7 @@ Lint/ShadowedException:
|
|
|
313
325
|
Enabled: false
|
|
314
326
|
Lint/ShadowingOuterLocalVariable:
|
|
315
327
|
Enabled: false
|
|
316
|
-
Lint/
|
|
328
|
+
Lint/SuppressedException:
|
|
317
329
|
Enabled: false
|
|
318
330
|
Lint/Syntax:
|
|
319
331
|
Enabled: false
|
|
@@ -323,14 +335,6 @@ Lint/UnderscorePrefixedVariableName:
|
|
|
323
335
|
Enabled: false
|
|
324
336
|
Lint/UnifiedInteger:
|
|
325
337
|
Enabled: false
|
|
326
|
-
Lint/UnneededCopDisableDirective:
|
|
327
|
-
Enabled: false
|
|
328
|
-
Lint/UnneededCopEnableDirective:
|
|
329
|
-
Enabled: false
|
|
330
|
-
Lint/UnneededRequireStatement:
|
|
331
|
-
Enabled: false
|
|
332
|
-
Lint/UnneededSplatExpansion:
|
|
333
|
-
Enabled: false
|
|
334
338
|
Lint/UnreachableCode:
|
|
335
339
|
Enabled: false
|
|
336
340
|
Lint/UnusedBlockArgument:
|
|
@@ -363,8 +367,6 @@ Metrics/BlockNesting:
|
|
|
363
367
|
Enabled: false
|
|
364
368
|
Metrics/ClassLength:
|
|
365
369
|
Enabled: false
|
|
366
|
-
Metrics/LineLength:
|
|
367
|
-
Enabled: false
|
|
368
370
|
Metrics/MethodLength:
|
|
369
371
|
Enabled: false
|
|
370
372
|
Metrics/ModuleLength:
|
|
@@ -377,6 +379,8 @@ Naming/AccessorMethodName:
|
|
|
377
379
|
Enabled: false
|
|
378
380
|
Naming/AsciiIdentifiers:
|
|
379
381
|
Enabled: false
|
|
382
|
+
Naming/BlockParameterName:
|
|
383
|
+
Enabled: false
|
|
380
384
|
Naming/ClassAndModuleCamelCase:
|
|
381
385
|
Enabled: false
|
|
382
386
|
Naming/ConstantName:
|
|
@@ -391,16 +395,14 @@ Naming/MemoizedInstanceVariableName:
|
|
|
391
395
|
Enabled: false
|
|
392
396
|
Naming/MethodName:
|
|
393
397
|
Enabled: false
|
|
398
|
+
Naming/MethodParameterName:
|
|
399
|
+
Enabled: false
|
|
394
400
|
Naming/BinaryOperatorParameterName:
|
|
395
401
|
Enabled: false
|
|
396
402
|
Naming/PredicateName:
|
|
397
403
|
Enabled: false
|
|
398
404
|
Naming/RescuedExceptionsVariableName:
|
|
399
405
|
Enabled: false
|
|
400
|
-
Naming/UncommunicativeBlockParamName:
|
|
401
|
-
Enabled: false
|
|
402
|
-
Naming/UncommunicativeMethodParamName:
|
|
403
|
-
Enabled: false
|
|
404
406
|
Naming/VariableName:
|
|
405
407
|
Enabled: false
|
|
406
408
|
Naming/VariableNumber:
|
|
@@ -427,8 +429,6 @@ Style/BlockComments:
|
|
|
427
429
|
Enabled: false
|
|
428
430
|
Style/BlockDelimiters:
|
|
429
431
|
Enabled: false
|
|
430
|
-
Style/BracesAroundHashParameters:
|
|
431
|
-
Enabled: false
|
|
432
432
|
Style/CaseEquality:
|
|
433
433
|
Enabled: false
|
|
434
434
|
Style/CharacterLiteral:
|
|
@@ -513,8 +513,14 @@ Style/GlobalVars:
|
|
|
513
513
|
Enabled: false
|
|
514
514
|
Style/GuardClause:
|
|
515
515
|
Enabled: false
|
|
516
|
+
Style/HashEachMethods:
|
|
517
|
+
Enabled: false
|
|
516
518
|
Style/HashSyntax:
|
|
517
519
|
Enabled: false
|
|
520
|
+
Style/HashTransformKeys:
|
|
521
|
+
Enabled: false
|
|
522
|
+
Style/HashTransformValues:
|
|
523
|
+
Enabled: false
|
|
518
524
|
Style/IdenticalConditionalBranches:
|
|
519
525
|
Enabled: false
|
|
520
526
|
Style/IfInsideElse:
|
|
@@ -635,18 +641,28 @@ Style/RandomWithOffset:
|
|
|
635
641
|
Enabled: false
|
|
636
642
|
Style/RedundantBegin:
|
|
637
643
|
Enabled: false
|
|
644
|
+
Style/RedundantCapitalW:
|
|
645
|
+
Enabled: false
|
|
646
|
+
Style/RedundantCondition:
|
|
647
|
+
Enabled: false
|
|
638
648
|
Style/RedundantConditional:
|
|
639
649
|
Enabled: false
|
|
640
650
|
Style/RedundantException:
|
|
641
651
|
Enabled: false
|
|
642
652
|
Style/RedundantFreeze:
|
|
643
653
|
Enabled: false
|
|
654
|
+
Style/RedundantInterpolation:
|
|
655
|
+
Enabled: false
|
|
644
656
|
Style/RedundantParentheses:
|
|
645
657
|
Enabled: false
|
|
658
|
+
Style/RedundantPercentQ:
|
|
659
|
+
Enabled: false
|
|
646
660
|
Style/RedundantReturn:
|
|
647
661
|
Enabled: false
|
|
648
662
|
Style/RedundantSelf:
|
|
649
663
|
Enabled: false
|
|
664
|
+
Style/RedundantSort:
|
|
665
|
+
Enabled: false
|
|
650
666
|
Style/RedundantSortBy:
|
|
651
667
|
Enabled: false
|
|
652
668
|
Style/RegexpLiteral:
|
|
@@ -719,16 +735,6 @@ Style/TrivialAccessors:
|
|
|
719
735
|
Enabled: false
|
|
720
736
|
Style/UnlessElse:
|
|
721
737
|
Enabled: false
|
|
722
|
-
Style/UnneededCapitalW:
|
|
723
|
-
Enabled: false
|
|
724
|
-
Style/UnneededCondition:
|
|
725
|
-
Enabled: false
|
|
726
|
-
Style/UnneededInterpolation:
|
|
727
|
-
Enabled: false
|
|
728
|
-
Style/UnneededPercentQ:
|
|
729
|
-
Enabled: false
|
|
730
|
-
Style/UnneededSort:
|
|
731
|
-
Enabled: false
|
|
732
738
|
Style/UnpackFirst:
|
|
733
739
|
Enabled: false
|
|
734
740
|
Style/VariableInterpolation:
|
|
@@ -754,4 +760,4 @@ Security/MarshalLoad:
|
|
|
754
760
|
Security/Open:
|
|
755
761
|
Enabled: false
|
|
756
762
|
Security/YAMLLoad:
|
|
757
|
-
Enabled: false
|
|
763
|
+
Enabled: false
|
data/config/upstream.yml
CHANGED
|
@@ -54,11 +54,13 @@ AllCops:
|
|
|
54
54
|
- '**/Puppetfile'
|
|
55
55
|
- '**/Rakefile'
|
|
56
56
|
- '**/Snapfile'
|
|
57
|
+
- '**/Steepfile'
|
|
57
58
|
- '**/Thorfile'
|
|
58
59
|
- '**/Vagabondfile'
|
|
59
60
|
- '**/Vagrantfile'
|
|
60
61
|
Exclude:
|
|
61
62
|
- 'node_modules/**/*'
|
|
63
|
+
- 'tmp/**/*'
|
|
62
64
|
- 'vendor/**/*'
|
|
63
65
|
- '.git/**/*'
|
|
64
66
|
# Default formatter will be used if no `-f/--format` option is given.
|
|
@@ -141,11 +143,12 @@ Bundler/GemComment:
|
|
|
141
143
|
Description: 'Add a comment describing each gem.'
|
|
142
144
|
Enabled: false
|
|
143
145
|
VersionAdded: '0.59'
|
|
146
|
+
VersionChanged: '0.77'
|
|
144
147
|
Include:
|
|
145
148
|
- '**/*.gemfile'
|
|
146
149
|
- '**/Gemfile'
|
|
147
150
|
- '**/gems.rb'
|
|
148
|
-
|
|
151
|
+
IgnoredGems: []
|
|
149
152
|
|
|
150
153
|
Bundler/InsecureProtocolSource:
|
|
151
154
|
Description: >-
|
|
@@ -195,9 +198,10 @@ Gemspec/RequiredRubyVersion:
|
|
|
195
198
|
VersionAdded: '0.52'
|
|
196
199
|
Include:
|
|
197
200
|
- '**/*.gemspec'
|
|
198
|
-
|
|
201
|
+
|
|
199
202
|
Gemspec/RubyVersionGlobalsUsage:
|
|
200
203
|
Description: Checks usage of RUBY_VERSION in gemspec.
|
|
204
|
+
StyleGuide: '#no-ruby-version-in-the-gemspec'
|
|
201
205
|
Enabled: true
|
|
202
206
|
VersionAdded: '0.72'
|
|
203
207
|
Include:
|
|
@@ -218,13 +222,14 @@ Layout/AccessModifierIndentation:
|
|
|
218
222
|
# But it can be overridden by setting this parameter
|
|
219
223
|
IndentationWidth: ~
|
|
220
224
|
|
|
221
|
-
Layout/
|
|
225
|
+
Layout/ArgumentAlignment:
|
|
222
226
|
Description: >-
|
|
223
227
|
Align the arguments of a method call if they span more
|
|
224
228
|
than one line.
|
|
225
229
|
StyleGuide: '#no-double-indent'
|
|
226
230
|
Enabled: true
|
|
227
231
|
VersionAdded: '0.68'
|
|
232
|
+
VersionChanged: '0.77'
|
|
228
233
|
# Alignment of arguments in multi-line method calls.
|
|
229
234
|
#
|
|
230
235
|
# The `with_first_argument` style aligns the following lines along the same
|
|
@@ -246,117 +251,23 @@ Layout/AlignArguments:
|
|
|
246
251
|
# But it can be overridden by setting this parameter
|
|
247
252
|
IndentationWidth: ~
|
|
248
253
|
|
|
249
|
-
Layout/
|
|
254
|
+
Layout/ArrayAlignment:
|
|
250
255
|
Description: >-
|
|
251
256
|
Align the elements of an array literal if they span more than
|
|
252
257
|
one line.
|
|
253
258
|
StyleGuide: '#align-multiline-arrays'
|
|
254
259
|
Enabled: true
|
|
255
260
|
VersionAdded: '0.49'
|
|
261
|
+
VersionChanged: '0.77'
|
|
256
262
|
|
|
257
|
-
Layout/
|
|
263
|
+
Layout/AssignmentIndentation:
|
|
258
264
|
Description: >-
|
|
259
|
-
|
|
260
|
-
|
|
265
|
+
Checks the indentation of the first line of the
|
|
266
|
+
right-hand-side of a multi-line assignment.
|
|
261
267
|
Enabled: true
|
|
262
|
-
AllowMultipleStyles: true
|
|
263
268
|
VersionAdded: '0.49'
|
|
264
|
-
|
|
265
|
-
#
|
|
266
|
-
# key - left alignment of keys
|
|
267
|
-
# 'a' => 2
|
|
268
|
-
# 'bb' => 3
|
|
269
|
-
# separator - alignment of hash rockets, keys are right aligned
|
|
270
|
-
# 'a' => 2
|
|
271
|
-
# 'bb' => 3
|
|
272
|
-
# table - left alignment of keys, hash rockets, and values
|
|
273
|
-
# 'a' => 2
|
|
274
|
-
# 'bb' => 3
|
|
275
|
-
EnforcedHashRocketStyle: key
|
|
276
|
-
SupportedHashRocketStyles:
|
|
277
|
-
- key
|
|
278
|
-
- separator
|
|
279
|
-
- table
|
|
280
|
-
# Alignment of entries using colon as separator. Valid values are:
|
|
281
|
-
#
|
|
282
|
-
# key - left alignment of keys
|
|
283
|
-
# a: 0
|
|
284
|
-
# bb: 1
|
|
285
|
-
# separator - alignment of colons, keys are right aligned
|
|
286
|
-
# a: 0
|
|
287
|
-
# bb: 1
|
|
288
|
-
# table - left alignment of keys and values
|
|
289
|
-
# a: 0
|
|
290
|
-
# bb: 1
|
|
291
|
-
EnforcedColonStyle: key
|
|
292
|
-
SupportedColonStyles:
|
|
293
|
-
- key
|
|
294
|
-
- separator
|
|
295
|
-
- table
|
|
296
|
-
# Select whether hashes that are the last argument in a method call should be
|
|
297
|
-
# inspected? Valid values are:
|
|
298
|
-
#
|
|
299
|
-
# always_inspect - Inspect both implicit and explicit hashes.
|
|
300
|
-
# Registers an offense for:
|
|
301
|
-
# function(a: 1,
|
|
302
|
-
# b: 2)
|
|
303
|
-
# Registers an offense for:
|
|
304
|
-
# function({a: 1,
|
|
305
|
-
# b: 2})
|
|
306
|
-
# always_ignore - Ignore both implicit and explicit hashes.
|
|
307
|
-
# Accepts:
|
|
308
|
-
# function(a: 1,
|
|
309
|
-
# b: 2)
|
|
310
|
-
# Accepts:
|
|
311
|
-
# function({a: 1,
|
|
312
|
-
# b: 2})
|
|
313
|
-
# ignore_implicit - Ignore only implicit hashes.
|
|
314
|
-
# Accepts:
|
|
315
|
-
# function(a: 1,
|
|
316
|
-
# b: 2)
|
|
317
|
-
# Registers an offense for:
|
|
318
|
-
# function({a: 1,
|
|
319
|
-
# b: 2})
|
|
320
|
-
# ignore_explicit - Ignore only explicit hashes.
|
|
321
|
-
# Accepts:
|
|
322
|
-
# function({a: 1,
|
|
323
|
-
# b: 2})
|
|
324
|
-
# Registers an offense for:
|
|
325
|
-
# function(a: 1,
|
|
326
|
-
# b: 2)
|
|
327
|
-
EnforcedLastArgumentHashStyle: always_inspect
|
|
328
|
-
SupportedLastArgumentHashStyles:
|
|
329
|
-
- always_inspect
|
|
330
|
-
- always_ignore
|
|
331
|
-
- ignore_implicit
|
|
332
|
-
- ignore_explicit
|
|
333
|
-
|
|
334
|
-
Layout/AlignParameters:
|
|
335
|
-
Description: >-
|
|
336
|
-
Align the parameters of a method definition if they span more
|
|
337
|
-
than one line.
|
|
338
|
-
StyleGuide: '#no-double-indent'
|
|
339
|
-
Enabled: true
|
|
340
|
-
VersionAdded: '0.49'
|
|
341
|
-
VersionChanged: '0.68'
|
|
342
|
-
# Alignment of parameters in multi-line method calls.
|
|
343
|
-
#
|
|
344
|
-
# The `with_first_parameter` style aligns the following lines along the same
|
|
345
|
-
# column as the first parameter.
|
|
346
|
-
#
|
|
347
|
-
# def method_foo(a,
|
|
348
|
-
# b)
|
|
349
|
-
#
|
|
350
|
-
# The `with_fixed_indentation` style aligns the following lines with one
|
|
351
|
-
# level of indentation relative to the start of the line with the method call.
|
|
352
|
-
#
|
|
353
|
-
# def method_foo(a,
|
|
354
|
-
# b)
|
|
355
|
-
EnforcedStyle: with_first_parameter
|
|
356
|
-
SupportedStyles:
|
|
357
|
-
- with_first_parameter
|
|
358
|
-
- with_fixed_indentation
|
|
359
|
-
# By default, the indentation width from Layout/IndentationWidth is used
|
|
269
|
+
VersionChanged: '0.77'
|
|
270
|
+
# By default, the indentation width from `Layout/IndentationWidth` is used
|
|
360
271
|
# But it can be overridden by setting this parameter
|
|
361
272
|
IndentationWidth: ~
|
|
362
273
|
|
|
@@ -624,56 +535,11 @@ Layout/ExtraSpacing:
|
|
|
624
535
|
# When true, forces the alignment of `=` in assignments on consecutive lines.
|
|
625
536
|
ForceEqualSignAlignment: false
|
|
626
537
|
|
|
627
|
-
Layout/
|
|
628
|
-
Description: >-
|
|
629
|
-
Checks for a line break before the first element in a
|
|
630
|
-
multi-line array.
|
|
631
|
-
Enabled: false
|
|
632
|
-
VersionAdded: '0.49'
|
|
633
|
-
|
|
634
|
-
Layout/FirstHashElementLineBreak:
|
|
635
|
-
Description: >-
|
|
636
|
-
Checks for a line break before the first element in a
|
|
637
|
-
multi-line hash.
|
|
638
|
-
Enabled: false
|
|
639
|
-
VersionAdded: '0.49'
|
|
640
|
-
|
|
641
|
-
Layout/FirstMethodArgumentLineBreak:
|
|
642
|
-
Description: >-
|
|
643
|
-
Checks for a line break before the first argument in a
|
|
644
|
-
multi-line method call.
|
|
645
|
-
Enabled: false
|
|
646
|
-
VersionAdded: '0.49'
|
|
647
|
-
|
|
648
|
-
Layout/FirstMethodParameterLineBreak:
|
|
649
|
-
Description: >-
|
|
650
|
-
Checks for a line break before the first parameter in a
|
|
651
|
-
multi-line method parameter definition.
|
|
652
|
-
Enabled: false
|
|
653
|
-
VersionAdded: '0.49'
|
|
654
|
-
|
|
655
|
-
Layout/HeredocArgumentClosingParenthesis:
|
|
656
|
-
Description: >-
|
|
657
|
-
Checks for the placement of the closing parenthesis in a
|
|
658
|
-
method call that passes a HEREDOC string as an argument.
|
|
659
|
-
Enabled: false
|
|
660
|
-
StyleGuide: '#heredoc-argument-closing-parentheses'
|
|
661
|
-
VersionAdded: '0.68'
|
|
662
|
-
|
|
663
|
-
Layout/IndentAssignment:
|
|
664
|
-
Description: >-
|
|
665
|
-
Checks the indentation of the first line of the
|
|
666
|
-
right-hand-side of a multi-line assignment.
|
|
667
|
-
Enabled: true
|
|
668
|
-
VersionAdded: '0.49'
|
|
669
|
-
# By default, the indentation width from `Layout/IndentationWidth` is used
|
|
670
|
-
# But it can be overridden by setting this parameter
|
|
671
|
-
IndentationWidth: ~
|
|
672
|
-
|
|
673
|
-
Layout/IndentFirstArgument:
|
|
538
|
+
Layout/FirstArgumentIndentation:
|
|
674
539
|
Description: 'Checks the indentation of the first argument in a method call.'
|
|
675
540
|
Enabled: true
|
|
676
541
|
VersionAdded: '0.68'
|
|
542
|
+
VersionChanged: '0.77'
|
|
677
543
|
EnforcedStyle: special_for_inner_method_call_in_parentheses
|
|
678
544
|
SupportedStyles:
|
|
679
545
|
# The first parameter should always be indented one step more than the
|
|
@@ -694,12 +560,13 @@ Layout/IndentFirstArgument:
|
|
|
694
560
|
# But it can be overridden by setting this parameter
|
|
695
561
|
IndentationWidth: ~
|
|
696
562
|
|
|
697
|
-
Layout/
|
|
563
|
+
Layout/FirstArrayElementIndentation:
|
|
698
564
|
Description: >-
|
|
699
565
|
Checks the indentation of the first element in an array
|
|
700
566
|
literal.
|
|
701
567
|
Enabled: true
|
|
702
568
|
VersionAdded: '0.68'
|
|
569
|
+
VersionChanged: '0.77'
|
|
703
570
|
# The value `special_inside_parentheses` means that array literals with
|
|
704
571
|
# brackets that have their opening bracket on the same line as a surrounding
|
|
705
572
|
# opening round parenthesis, shall have their first element indented relative
|
|
@@ -720,10 +587,18 @@ Layout/IndentFirstArrayElement:
|
|
|
720
587
|
# But it can be overridden by setting this parameter
|
|
721
588
|
IndentationWidth: ~
|
|
722
589
|
|
|
723
|
-
Layout/
|
|
590
|
+
Layout/FirstArrayElementLineBreak:
|
|
591
|
+
Description: >-
|
|
592
|
+
Checks for a line break before the first element in a
|
|
593
|
+
multi-line array.
|
|
594
|
+
Enabled: false
|
|
595
|
+
VersionAdded: '0.49'
|
|
596
|
+
|
|
597
|
+
Layout/FirstHashElementIndentation:
|
|
724
598
|
Description: 'Checks the indentation of the first key in a hash literal.'
|
|
725
599
|
Enabled: true
|
|
726
600
|
VersionAdded: '0.68'
|
|
601
|
+
VersionChanged: '0.77'
|
|
727
602
|
# The value `special_inside_parentheses` means that hash literals with braces
|
|
728
603
|
# that have their opening brace on the same line as a surrounding opening
|
|
729
604
|
# round parenthesis, shall have their first key indented relative to the
|
|
@@ -744,13 +619,34 @@ Layout/IndentFirstHashElement:
|
|
|
744
619
|
# But it can be overridden by setting this parameter
|
|
745
620
|
IndentationWidth: ~
|
|
746
621
|
|
|
747
|
-
Layout/
|
|
622
|
+
Layout/FirstHashElementLineBreak:
|
|
623
|
+
Description: >-
|
|
624
|
+
Checks for a line break before the first element in a
|
|
625
|
+
multi-line hash.
|
|
626
|
+
Enabled: false
|
|
627
|
+
VersionAdded: '0.49'
|
|
628
|
+
|
|
629
|
+
Layout/FirstMethodArgumentLineBreak:
|
|
630
|
+
Description: >-
|
|
631
|
+
Checks for a line break before the first argument in a
|
|
632
|
+
multi-line method call.
|
|
633
|
+
Enabled: false
|
|
634
|
+
VersionAdded: '0.49'
|
|
635
|
+
|
|
636
|
+
Layout/FirstMethodParameterLineBreak:
|
|
637
|
+
Description: >-
|
|
638
|
+
Checks for a line break before the first parameter in a
|
|
639
|
+
multi-line method parameter definition.
|
|
640
|
+
Enabled: false
|
|
641
|
+
VersionAdded: '0.49'
|
|
642
|
+
|
|
643
|
+
Layout/FirstParameterIndentation:
|
|
748
644
|
Description: >-
|
|
749
645
|
Checks the indentation of the first parameter in a
|
|
750
646
|
method definition.
|
|
751
647
|
Enabled: true
|
|
752
648
|
VersionAdded: '0.49'
|
|
753
|
-
VersionChanged: '0.
|
|
649
|
+
VersionChanged: '0.77'
|
|
754
650
|
EnforcedStyle: consistent
|
|
755
651
|
SupportedStyles:
|
|
756
652
|
- consistent
|
|
@@ -759,12 +655,98 @@ Layout/IndentFirstParameter:
|
|
|
759
655
|
# But it can be overridden by setting this parameter
|
|
760
656
|
IndentationWidth: ~
|
|
761
657
|
|
|
762
|
-
Layout/
|
|
658
|
+
Layout/HashAlignment:
|
|
659
|
+
Description: >-
|
|
660
|
+
Align the elements of a hash literal if they span more than
|
|
661
|
+
one line.
|
|
662
|
+
Enabled: true
|
|
663
|
+
AllowMultipleStyles: true
|
|
664
|
+
VersionAdded: '0.49'
|
|
665
|
+
VersionChanged: '0.77'
|
|
666
|
+
# Alignment of entries using hash rocket as separator. Valid values are:
|
|
667
|
+
#
|
|
668
|
+
# key - left alignment of keys
|
|
669
|
+
# 'a' => 2
|
|
670
|
+
# 'bb' => 3
|
|
671
|
+
# separator - alignment of hash rockets, keys are right aligned
|
|
672
|
+
# 'a' => 2
|
|
673
|
+
# 'bb' => 3
|
|
674
|
+
# table - left alignment of keys, hash rockets, and values
|
|
675
|
+
# 'a' => 2
|
|
676
|
+
# 'bb' => 3
|
|
677
|
+
EnforcedHashRocketStyle: key
|
|
678
|
+
SupportedHashRocketStyles:
|
|
679
|
+
- key
|
|
680
|
+
- separator
|
|
681
|
+
- table
|
|
682
|
+
# Alignment of entries using colon as separator. Valid values are:
|
|
683
|
+
#
|
|
684
|
+
# key - left alignment of keys
|
|
685
|
+
# a: 0
|
|
686
|
+
# bb: 1
|
|
687
|
+
# separator - alignment of colons, keys are right aligned
|
|
688
|
+
# a: 0
|
|
689
|
+
# bb: 1
|
|
690
|
+
# table - left alignment of keys and values
|
|
691
|
+
# a: 0
|
|
692
|
+
# bb: 1
|
|
693
|
+
EnforcedColonStyle: key
|
|
694
|
+
SupportedColonStyles:
|
|
695
|
+
- key
|
|
696
|
+
- separator
|
|
697
|
+
- table
|
|
698
|
+
# Select whether hashes that are the last argument in a method call should be
|
|
699
|
+
# inspected? Valid values are:
|
|
700
|
+
#
|
|
701
|
+
# always_inspect - Inspect both implicit and explicit hashes.
|
|
702
|
+
# Registers an offense for:
|
|
703
|
+
# function(a: 1,
|
|
704
|
+
# b: 2)
|
|
705
|
+
# Registers an offense for:
|
|
706
|
+
# function({a: 1,
|
|
707
|
+
# b: 2})
|
|
708
|
+
# always_ignore - Ignore both implicit and explicit hashes.
|
|
709
|
+
# Accepts:
|
|
710
|
+
# function(a: 1,
|
|
711
|
+
# b: 2)
|
|
712
|
+
# Accepts:
|
|
713
|
+
# function({a: 1,
|
|
714
|
+
# b: 2})
|
|
715
|
+
# ignore_implicit - Ignore only implicit hashes.
|
|
716
|
+
# Accepts:
|
|
717
|
+
# function(a: 1,
|
|
718
|
+
# b: 2)
|
|
719
|
+
# Registers an offense for:
|
|
720
|
+
# function({a: 1,
|
|
721
|
+
# b: 2})
|
|
722
|
+
# ignore_explicit - Ignore only explicit hashes.
|
|
723
|
+
# Accepts:
|
|
724
|
+
# function({a: 1,
|
|
725
|
+
# b: 2})
|
|
726
|
+
# Registers an offense for:
|
|
727
|
+
# function(a: 1,
|
|
728
|
+
# b: 2)
|
|
729
|
+
EnforcedLastArgumentHashStyle: always_inspect
|
|
730
|
+
SupportedLastArgumentHashStyles:
|
|
731
|
+
- always_inspect
|
|
732
|
+
- always_ignore
|
|
733
|
+
- ignore_implicit
|
|
734
|
+
- ignore_explicit
|
|
735
|
+
|
|
736
|
+
Layout/HeredocArgumentClosingParenthesis:
|
|
737
|
+
Description: >-
|
|
738
|
+
Checks for the placement of the closing parenthesis in a
|
|
739
|
+
method call that passes a HEREDOC string as an argument.
|
|
740
|
+
Enabled: false
|
|
741
|
+
StyleGuide: '#heredoc-argument-closing-parentheses'
|
|
742
|
+
VersionAdded: '0.68'
|
|
743
|
+
|
|
744
|
+
Layout/HeredocIndentation:
|
|
763
745
|
Description: 'This cop checks the indentation of the here document bodies.'
|
|
764
746
|
StyleGuide: '#squiggly-heredocs'
|
|
765
747
|
Enabled: true
|
|
766
748
|
VersionAdded: '0.49'
|
|
767
|
-
VersionChanged: '0.
|
|
749
|
+
VersionChanged: '0.77'
|
|
768
750
|
EnforcedStyle: squiggly
|
|
769
751
|
SupportedStyles:
|
|
770
752
|
- squiggly
|
|
@@ -806,11 +788,6 @@ Layout/InitialIndentation:
|
|
|
806
788
|
Enabled: true
|
|
807
789
|
VersionAdded: '0.49'
|
|
808
790
|
|
|
809
|
-
Layout/LeadingBlankLines:
|
|
810
|
-
Description: Check for unnecessary blank lines at the beginning of a file.
|
|
811
|
-
Enabled: true
|
|
812
|
-
VersionAdded: '0.57'
|
|
813
|
-
|
|
814
791
|
Layout/LeadingCommentSpace:
|
|
815
792
|
Description: 'Comments should start with a space.'
|
|
816
793
|
StyleGuide: '#hash-space'
|
|
@@ -818,6 +795,36 @@ Layout/LeadingCommentSpace:
|
|
|
818
795
|
VersionAdded: '0.49'
|
|
819
796
|
VersionChanged: '0.73'
|
|
820
797
|
AllowDoxygenCommentStyle: false
|
|
798
|
+
AllowGemfileRubyComment: false
|
|
799
|
+
|
|
800
|
+
Layout/LeadingEmptyLines:
|
|
801
|
+
Description: Check for unnecessary blank lines at the beginning of a file.
|
|
802
|
+
Enabled: true
|
|
803
|
+
VersionAdded: '0.57'
|
|
804
|
+
VersionChanged: '0.77'
|
|
805
|
+
|
|
806
|
+
Layout/LineLength:
|
|
807
|
+
Description: 'Limit lines to 80 characters.'
|
|
808
|
+
StyleGuide: '#80-character-limits'
|
|
809
|
+
Enabled: true
|
|
810
|
+
VersionAdded: '0.25'
|
|
811
|
+
VersionChanged: '0.78'
|
|
812
|
+
AutoCorrect: false
|
|
813
|
+
Max: 80
|
|
814
|
+
# To make it possible to copy or click on URIs in the code, we allow lines
|
|
815
|
+
# containing a URI to be longer than Max.
|
|
816
|
+
AllowHeredoc: true
|
|
817
|
+
AllowURI: true
|
|
818
|
+
URISchemes:
|
|
819
|
+
- http
|
|
820
|
+
- https
|
|
821
|
+
# The IgnoreCopDirectives option causes the LineLength rule to ignore cop
|
|
822
|
+
# directives like '# rubocop: enable ...' when calculating a line's length.
|
|
823
|
+
IgnoreCopDirectives: true
|
|
824
|
+
# The IgnoredPatterns option is a list of !ruby/regexp and/or string
|
|
825
|
+
# elements. Strings will be converted to Regexp objects. A line that matches
|
|
826
|
+
# any regular expression listed in this option will be ignored by LineLength.
|
|
827
|
+
IgnoredPatterns: []
|
|
821
828
|
|
|
822
829
|
Layout/MultilineArrayBraceLayout:
|
|
823
830
|
Description: >-
|
|
@@ -960,6 +967,35 @@ Layout/MultilineOperationIndentation:
|
|
|
960
967
|
# But it can be overridden by setting this parameter
|
|
961
968
|
IndentationWidth: ~
|
|
962
969
|
|
|
970
|
+
Layout/ParameterAlignment:
|
|
971
|
+
Description: >-
|
|
972
|
+
Align the parameters of a method definition if they span more
|
|
973
|
+
than one line.
|
|
974
|
+
StyleGuide: '#no-double-indent'
|
|
975
|
+
Enabled: true
|
|
976
|
+
VersionAdded: '0.49'
|
|
977
|
+
VersionChanged: '0.77'
|
|
978
|
+
# Alignment of parameters in multi-line method calls.
|
|
979
|
+
#
|
|
980
|
+
# The `with_first_parameter` style aligns the following lines along the same
|
|
981
|
+
# column as the first parameter.
|
|
982
|
+
#
|
|
983
|
+
# def method_foo(a,
|
|
984
|
+
# b)
|
|
985
|
+
#
|
|
986
|
+
# The `with_fixed_indentation` style aligns the following lines with one
|
|
987
|
+
# level of indentation relative to the start of the line with the method call.
|
|
988
|
+
#
|
|
989
|
+
# def method_foo(a,
|
|
990
|
+
# b)
|
|
991
|
+
EnforcedStyle: with_first_parameter
|
|
992
|
+
SupportedStyles:
|
|
993
|
+
- with_first_parameter
|
|
994
|
+
- with_fixed_indentation
|
|
995
|
+
# By default, the indentation width from Layout/IndentationWidth is used
|
|
996
|
+
# But it can be overridden by setting this parameter
|
|
997
|
+
IndentationWidth: ~
|
|
998
|
+
|
|
963
999
|
Layout/RescueEnsureAlignment:
|
|
964
1000
|
Description: 'Align rescues and ensures correctly.'
|
|
965
1001
|
Enabled: true
|
|
@@ -1033,6 +1069,10 @@ Layout/SpaceAroundOperators:
|
|
|
1033
1069
|
# with an operator on the previous or next line, not counting empty lines
|
|
1034
1070
|
# or comment lines.
|
|
1035
1071
|
AllowForAlignment: true
|
|
1072
|
+
EnforcedStyleForExponentOperator: no_space
|
|
1073
|
+
SupportedStylesForExponentOperator:
|
|
1074
|
+
- space
|
|
1075
|
+
- no_space
|
|
1036
1076
|
|
|
1037
1077
|
Layout/SpaceBeforeBlockBraces:
|
|
1038
1078
|
Description: >-
|
|
@@ -1202,11 +1242,12 @@ Layout/Tab:
|
|
|
1202
1242
|
# replace each tab.
|
|
1203
1243
|
IndentationWidth: ~
|
|
1204
1244
|
|
|
1205
|
-
Layout/
|
|
1245
|
+
Layout/TrailingEmptyLines:
|
|
1206
1246
|
Description: 'Checks trailing blank lines and final newline.'
|
|
1207
1247
|
StyleGuide: '#newline-eof'
|
|
1208
1248
|
Enabled: true
|
|
1209
1249
|
VersionAdded: '0.49'
|
|
1250
|
+
VersionChanged: '0.77'
|
|
1210
1251
|
EnforcedStyle: final_newline
|
|
1211
1252
|
SupportedStyles:
|
|
1212
1253
|
- final_newline
|
|
@@ -1290,16 +1331,17 @@ Lint/DuplicateCaseCondition:
|
|
|
1290
1331
|
Enabled: true
|
|
1291
1332
|
VersionAdded: '0.45'
|
|
1292
1333
|
|
|
1334
|
+
Lint/DuplicateHashKey:
|
|
1335
|
+
Description: 'Check for duplicate keys in hash literals.'
|
|
1336
|
+
Enabled: true
|
|
1337
|
+
VersionAdded: '0.34'
|
|
1338
|
+
VersionChanged: '0.77'
|
|
1339
|
+
|
|
1293
1340
|
Lint/DuplicateMethods:
|
|
1294
1341
|
Description: 'Check for duplicate method definitions.'
|
|
1295
1342
|
Enabled: true
|
|
1296
1343
|
VersionAdded: '0.29'
|
|
1297
1344
|
|
|
1298
|
-
Lint/DuplicatedKey:
|
|
1299
|
-
Description: 'Check for duplicate keys in hash literals.'
|
|
1300
|
-
Enabled: true
|
|
1301
|
-
VersionAdded: '0.34'
|
|
1302
|
-
|
|
1303
1345
|
Lint/EachWithObjectArgument:
|
|
1304
1346
|
Description: 'Check for immutable argument given to each_with_object.'
|
|
1305
1347
|
Enabled: true
|
|
@@ -1367,14 +1409,6 @@ Lint/FormatParameterMismatch:
|
|
|
1367
1409
|
Enabled: true
|
|
1368
1410
|
VersionAdded: '0.33'
|
|
1369
1411
|
|
|
1370
|
-
Lint/HandleExceptions:
|
|
1371
|
-
Description: "Don't suppress exception."
|
|
1372
|
-
StyleGuide: '#dont-hide-exceptions'
|
|
1373
|
-
Enabled: true
|
|
1374
|
-
AllowComments: false
|
|
1375
|
-
VersionAdded: '0.9'
|
|
1376
|
-
VersionChanged: '0.70'
|
|
1377
|
-
|
|
1378
1412
|
Lint/HeredocMethodCallPosition:
|
|
1379
1413
|
Description: >-
|
|
1380
1414
|
Checks for the ordering of a method call where
|
|
@@ -1444,10 +1478,11 @@ Lint/MissingCopEnableDirective:
|
|
|
1444
1478
|
# .inf for any size
|
|
1445
1479
|
MaximumRangeSize: .inf
|
|
1446
1480
|
|
|
1447
|
-
Lint/
|
|
1448
|
-
Description: "Use `&&` operator to compare multiple
|
|
1481
|
+
Lint/MultipleComparison:
|
|
1482
|
+
Description: "Use `&&` operator to compare multiple values."
|
|
1449
1483
|
Enabled: true
|
|
1450
1484
|
VersionAdded: '0.47'
|
|
1485
|
+
VersionChanged: '0.77'
|
|
1451
1486
|
|
|
1452
1487
|
Lint/NestedMethodDefinition:
|
|
1453
1488
|
Description: 'Do not use nested method definitions.'
|
|
@@ -1467,6 +1502,12 @@ Lint/NextWithoutAccumulator:
|
|
|
1467
1502
|
Enabled: true
|
|
1468
1503
|
VersionAdded: '0.36'
|
|
1469
1504
|
|
|
1505
|
+
Lint/NonDeterministicRequireOrder:
|
|
1506
|
+
Description: 'Always sort arrays returned by Dir.glob when requiring files.'
|
|
1507
|
+
Enabled: true
|
|
1508
|
+
VersionAdded: '0.78'
|
|
1509
|
+
Safe: false
|
|
1510
|
+
|
|
1470
1511
|
Lint/NonLocalExitFromIterator:
|
|
1471
1512
|
Description: 'Do not use return in iterator to cause non-local exit.'
|
|
1472
1513
|
Enabled: true
|
|
@@ -1512,6 +1553,36 @@ Lint/RandOne:
|
|
|
1512
1553
|
Enabled: true
|
|
1513
1554
|
VersionAdded: '0.36'
|
|
1514
1555
|
|
|
1556
|
+
Lint/RedundantCopDisableDirective:
|
|
1557
|
+
Description: >-
|
|
1558
|
+
Checks for rubocop:disable comments that can be removed.
|
|
1559
|
+
Note: this cop is not disabled when disabling all cops.
|
|
1560
|
+
It must be explicitly disabled.
|
|
1561
|
+
Enabled: true
|
|
1562
|
+
VersionAdded: '0.76'
|
|
1563
|
+
|
|
1564
|
+
Lint/RedundantCopEnableDirective:
|
|
1565
|
+
Description: Checks for rubocop:enable comments that can be removed.
|
|
1566
|
+
Enabled: true
|
|
1567
|
+
VersionAdded: '0.76'
|
|
1568
|
+
|
|
1569
|
+
Lint/RedundantRequireStatement:
|
|
1570
|
+
Description: 'Checks for unnecessary `require` statement.'
|
|
1571
|
+
Enabled: true
|
|
1572
|
+
VersionAdded: '0.76'
|
|
1573
|
+
|
|
1574
|
+
Lint/RedundantSplatExpansion:
|
|
1575
|
+
Description: 'Checks for splat unnecessarily being called on literals.'
|
|
1576
|
+
Enabled: true
|
|
1577
|
+
VersionChanged: '0.76'
|
|
1578
|
+
|
|
1579
|
+
Lint/RedundantStringCoercion:
|
|
1580
|
+
Description: 'Checks for Object#to_s usage in string interpolation.'
|
|
1581
|
+
StyleGuide: '#no-to-s'
|
|
1582
|
+
Enabled: true
|
|
1583
|
+
VersionAdded: '0.19'
|
|
1584
|
+
VersionChanged: '0.77'
|
|
1585
|
+
|
|
1515
1586
|
Lint/RedundantWithIndex:
|
|
1516
1587
|
Description: 'Checks for redundant `with_index`.'
|
|
1517
1588
|
Enabled: true
|
|
@@ -1557,8 +1628,8 @@ Lint/SafeNavigationChain:
|
|
|
1557
1628
|
Description: 'Do not chain ordinary method call after safe navigation operator.'
|
|
1558
1629
|
Enabled: true
|
|
1559
1630
|
VersionAdded: '0.47'
|
|
1560
|
-
VersionChanged: '0.
|
|
1561
|
-
|
|
1631
|
+
VersionChanged: '0.77'
|
|
1632
|
+
AllowedMethods:
|
|
1562
1633
|
- present?
|
|
1563
1634
|
- blank?
|
|
1564
1635
|
- presence
|
|
@@ -1572,14 +1643,14 @@ Lint/SafeNavigationConsistency:
|
|
|
1572
1643
|
for all method calls on that same object.
|
|
1573
1644
|
Enabled: true
|
|
1574
1645
|
VersionAdded: '0.55'
|
|
1575
|
-
|
|
1646
|
+
VersionChanged: '0.77'
|
|
1647
|
+
AllowedMethods:
|
|
1576
1648
|
- present?
|
|
1577
1649
|
- blank?
|
|
1578
1650
|
- presence
|
|
1579
1651
|
- try
|
|
1580
1652
|
- try!
|
|
1581
1653
|
|
|
1582
|
-
|
|
1583
1654
|
Lint/SafeNavigationWithEmpty:
|
|
1584
1655
|
Description: 'Avoid `foo&.empty?` in conditionals.'
|
|
1585
1656
|
Enabled: true
|
|
@@ -1617,12 +1688,13 @@ Lint/ShadowingOuterLocalVariable:
|
|
|
1617
1688
|
Enabled: true
|
|
1618
1689
|
VersionAdded: '0.9'
|
|
1619
1690
|
|
|
1620
|
-
Lint/
|
|
1621
|
-
Description: '
|
|
1622
|
-
StyleGuide: '#
|
|
1691
|
+
Lint/SuppressedException:
|
|
1692
|
+
Description: "Don't suppress exceptions."
|
|
1693
|
+
StyleGuide: '#dont-hide-exceptions'
|
|
1623
1694
|
Enabled: true
|
|
1624
|
-
|
|
1625
|
-
|
|
1695
|
+
AllowComments: false
|
|
1696
|
+
VersionAdded: '0.9'
|
|
1697
|
+
VersionChanged: '0.77'
|
|
1626
1698
|
|
|
1627
1699
|
Lint/Syntax:
|
|
1628
1700
|
Description: 'Checks syntax error.'
|
|
@@ -1645,30 +1717,6 @@ Lint/UnifiedInteger:
|
|
|
1645
1717
|
Enabled: true
|
|
1646
1718
|
VersionAdded: '0.43'
|
|
1647
1719
|
|
|
1648
|
-
Lint/UnneededCopDisableDirective:
|
|
1649
|
-
Description: >-
|
|
1650
|
-
Checks for rubocop:disable comments that can be removed.
|
|
1651
|
-
Note: this cop is not disabled when disabling all cops.
|
|
1652
|
-
It must be explicitly disabled.
|
|
1653
|
-
Enabled: true
|
|
1654
|
-
VersionAdded: '0.53'
|
|
1655
|
-
|
|
1656
|
-
Lint/UnneededCopEnableDirective:
|
|
1657
|
-
Description: Checks for rubocop:enable comments that can be removed.
|
|
1658
|
-
Enabled: true
|
|
1659
|
-
VersionAdded: '0.53'
|
|
1660
|
-
|
|
1661
|
-
Lint/UnneededRequireStatement:
|
|
1662
|
-
Description: 'Checks for unnecessary `require` statement.'
|
|
1663
|
-
Enabled: true
|
|
1664
|
-
VersionAdded: '0.51'
|
|
1665
|
-
|
|
1666
|
-
Lint/UnneededSplatExpansion:
|
|
1667
|
-
Description: 'Checks for splat unnecessarily being called on literals.'
|
|
1668
|
-
Enabled: true
|
|
1669
|
-
VersionAdded: '0.43'
|
|
1670
|
-
VersionChanged: '0.74'
|
|
1671
|
-
|
|
1672
1720
|
Lint/UnreachableCode:
|
|
1673
1721
|
Description: 'Unreachable code.'
|
|
1674
1722
|
Enabled: true
|
|
@@ -1736,6 +1784,8 @@ Lint/UselessSetterCall:
|
|
|
1736
1784
|
Description: 'Checks for useless setter call to a local variable.'
|
|
1737
1785
|
Enabled: true
|
|
1738
1786
|
VersionAdded: '0.13'
|
|
1787
|
+
VersionChanged: '0.80'
|
|
1788
|
+
Safe: false
|
|
1739
1789
|
|
|
1740
1790
|
Lint/Void:
|
|
1741
1791
|
Description: 'Possible use of operator/literal/variable in void context.'
|
|
@@ -1798,29 +1848,6 @@ Metrics/CyclomaticComplexity:
|
|
|
1798
1848
|
VersionAdded: '0.25'
|
|
1799
1849
|
Max: 6
|
|
1800
1850
|
|
|
1801
|
-
Metrics/LineLength:
|
|
1802
|
-
Description: 'Limit lines to 80 characters.'
|
|
1803
|
-
StyleGuide: '#80-character-limits'
|
|
1804
|
-
Enabled: true
|
|
1805
|
-
VersionAdded: '0.25'
|
|
1806
|
-
VersionChanged: '0.68'
|
|
1807
|
-
AutoCorrect: false
|
|
1808
|
-
Max: 80
|
|
1809
|
-
# To make it possible to copy or click on URIs in the code, we allow lines
|
|
1810
|
-
# containing a URI to be longer than Max.
|
|
1811
|
-
AllowHeredoc: true
|
|
1812
|
-
AllowURI: true
|
|
1813
|
-
URISchemes:
|
|
1814
|
-
- http
|
|
1815
|
-
- https
|
|
1816
|
-
# The IgnoreCopDirectives option causes the LineLength rule to ignore cop
|
|
1817
|
-
# directives like '# rubocop: enable ...' when calculating a line's length.
|
|
1818
|
-
IgnoreCopDirectives: true
|
|
1819
|
-
# The IgnoredPatterns option is a list of !ruby/regexp and/or string
|
|
1820
|
-
# elements. Strings will be converted to Regexp objects. A line that matches
|
|
1821
|
-
# any regular expression listed in this option will be ignored by LineLength.
|
|
1822
|
-
IgnoredPatterns: []
|
|
1823
|
-
|
|
1824
1851
|
Metrics/MethodLength:
|
|
1825
1852
|
Description: 'Avoid methods longer than 10 lines of code.'
|
|
1826
1853
|
StyleGuide: '#short-methods'
|
|
@@ -1860,7 +1887,7 @@ Migration/DepartmentName:
|
|
|
1860
1887
|
Description: >-
|
|
1861
1888
|
Check that cop names in rubocop:disable (etc) comments are
|
|
1862
1889
|
given with department name.
|
|
1863
|
-
Enabled:
|
|
1890
|
+
Enabled: true
|
|
1864
1891
|
|
|
1865
1892
|
#################### Naming ##############################
|
|
1866
1893
|
|
|
@@ -1882,6 +1909,21 @@ Naming/BinaryOperatorParameterName:
|
|
|
1882
1909
|
Enabled: true
|
|
1883
1910
|
VersionAdded: '0.50'
|
|
1884
1911
|
|
|
1912
|
+
Naming/BlockParameterName:
|
|
1913
|
+
Description: >-
|
|
1914
|
+
Checks for block parameter names that contain capital letters,
|
|
1915
|
+
end in numbers, or do not meet a minimal length.
|
|
1916
|
+
Enabled: true
|
|
1917
|
+
VersionAdded: '0.53'
|
|
1918
|
+
VersionChanged: '0.77'
|
|
1919
|
+
# Parameter names may be equal to or greater than this value
|
|
1920
|
+
MinNameLength: 1
|
|
1921
|
+
AllowNamesEndingInNumbers: true
|
|
1922
|
+
# Allowed names that will not register an offense
|
|
1923
|
+
AllowedNames: []
|
|
1924
|
+
# Forbidden names that will register an offense
|
|
1925
|
+
ForbiddenNames: []
|
|
1926
|
+
|
|
1885
1927
|
Naming/ClassAndModuleCamelCase:
|
|
1886
1928
|
Description: 'Use CamelCase for classes and modules.'
|
|
1887
1929
|
StyleGuide: '#camelcase-classes'
|
|
@@ -1973,7 +2015,7 @@ Naming/HeredocDelimiterNaming:
|
|
|
1973
2015
|
StyleGuide: '#heredoc-delimiters'
|
|
1974
2016
|
Enabled: true
|
|
1975
2017
|
VersionAdded: '0.50'
|
|
1976
|
-
|
|
2018
|
+
ForbiddenDelimiters:
|
|
1977
2019
|
- !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
|
|
1978
2020
|
|
|
1979
2021
|
Naming/MemoizedInstanceVariableName:
|
|
@@ -2005,25 +2047,51 @@ Naming/MethodName:
|
|
|
2005
2047
|
#
|
|
2006
2048
|
IgnoredPatterns: []
|
|
2007
2049
|
|
|
2050
|
+
Naming/MethodParameterName:
|
|
2051
|
+
Description: >-
|
|
2052
|
+
Checks for method parameter names that contain capital letters,
|
|
2053
|
+
end in numbers, or do not meet a minimal length.
|
|
2054
|
+
Enabled: true
|
|
2055
|
+
VersionAdded: '0.53'
|
|
2056
|
+
VersionChanged: '0.77'
|
|
2057
|
+
# Parameter names may be equal to or greater than this value
|
|
2058
|
+
MinNameLength: 3
|
|
2059
|
+
AllowNamesEndingInNumbers: true
|
|
2060
|
+
# Allowed names that will not register an offense
|
|
2061
|
+
AllowedNames:
|
|
2062
|
+
- io
|
|
2063
|
+
- id
|
|
2064
|
+
- to
|
|
2065
|
+
- by
|
|
2066
|
+
- 'on'
|
|
2067
|
+
- in
|
|
2068
|
+
- at
|
|
2069
|
+
- ip
|
|
2070
|
+
- db
|
|
2071
|
+
- os
|
|
2072
|
+
- pp
|
|
2073
|
+
# Forbidden names that will register an offense
|
|
2074
|
+
ForbiddenNames: []
|
|
2075
|
+
|
|
2008
2076
|
Naming/PredicateName:
|
|
2009
2077
|
Description: 'Check the names of predicate methods.'
|
|
2010
2078
|
StyleGuide: '#bool-methods-qmark'
|
|
2011
2079
|
Enabled: true
|
|
2012
2080
|
VersionAdded: '0.50'
|
|
2013
|
-
VersionChanged: '0.
|
|
2081
|
+
VersionChanged: '0.77'
|
|
2014
2082
|
# Predicate name prefixes.
|
|
2015
2083
|
NamePrefix:
|
|
2016
2084
|
- is_
|
|
2017
2085
|
- has_
|
|
2018
2086
|
- have_
|
|
2019
2087
|
# Predicate name prefixes that should be removed.
|
|
2020
|
-
|
|
2088
|
+
ForbiddenPrefixes:
|
|
2021
2089
|
- is_
|
|
2022
2090
|
- has_
|
|
2023
2091
|
- have_
|
|
2024
|
-
# Predicate names which, despite having a
|
|
2092
|
+
# Predicate names which, despite having a forbidden prefix, or no `?`,
|
|
2025
2093
|
# should still be accepted
|
|
2026
|
-
|
|
2094
|
+
AllowedMethods:
|
|
2027
2095
|
- is_a?
|
|
2028
2096
|
# Method definition macros for dynamically generated methods.
|
|
2029
2097
|
MethodDefinitionMacros:
|
|
@@ -2041,45 +2109,6 @@ Naming/RescuedExceptionsVariableName:
|
|
|
2041
2109
|
VersionChanged: '0.68'
|
|
2042
2110
|
PreferredName: e
|
|
2043
2111
|
|
|
2044
|
-
Naming/UncommunicativeBlockParamName:
|
|
2045
|
-
Description: >-
|
|
2046
|
-
Checks for block parameter names that contain capital letters,
|
|
2047
|
-
end in numbers, or do not meet a minimal length.
|
|
2048
|
-
Enabled: true
|
|
2049
|
-
VersionAdded: '0.53'
|
|
2050
|
-
# Parameter names may be equal to or greater than this value
|
|
2051
|
-
MinNameLength: 1
|
|
2052
|
-
AllowNamesEndingInNumbers: true
|
|
2053
|
-
# Whitelisted names that will not register an offense
|
|
2054
|
-
AllowedNames: []
|
|
2055
|
-
# Blacklisted names that will register an offense
|
|
2056
|
-
ForbiddenNames: []
|
|
2057
|
-
|
|
2058
|
-
Naming/UncommunicativeMethodParamName:
|
|
2059
|
-
Description: >-
|
|
2060
|
-
Checks for method parameter names that contain capital letters,
|
|
2061
|
-
end in numbers, or do not meet a minimal length.
|
|
2062
|
-
Enabled: true
|
|
2063
|
-
VersionAdded: '0.53'
|
|
2064
|
-
VersionChanged: '0.59'
|
|
2065
|
-
# Parameter names may be equal to or greater than this value
|
|
2066
|
-
MinNameLength: 3
|
|
2067
|
-
AllowNamesEndingInNumbers: true
|
|
2068
|
-
# Whitelisted names that will not register an offense
|
|
2069
|
-
AllowedNames:
|
|
2070
|
-
- io
|
|
2071
|
-
- id
|
|
2072
|
-
- to
|
|
2073
|
-
- by
|
|
2074
|
-
- 'on'
|
|
2075
|
-
- in
|
|
2076
|
-
- at
|
|
2077
|
-
- ip
|
|
2078
|
-
- db
|
|
2079
|
-
# Blacklisted names that will register an offense
|
|
2080
|
-
ForbiddenNames: []
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
2112
|
Naming/VariableName:
|
|
2084
2113
|
Description: 'Use the configured style when naming variables.'
|
|
2085
2114
|
StyleGuide: '#snake-case-symbols-methods-vars'
|
|
@@ -2331,24 +2360,12 @@ Style/BlockDelimiters:
|
|
|
2331
2360
|
# # also good
|
|
2332
2361
|
# collection.each do |element| puts element end
|
|
2333
2362
|
AllowBracesOnProceduralOneLiners: false
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
EnforcedStyle: no_braces
|
|
2341
|
-
SupportedStyles:
|
|
2342
|
-
# The `braces` style enforces braces around all method parameters that are
|
|
2343
|
-
# hashes.
|
|
2344
|
-
- braces
|
|
2345
|
-
# The `no_braces` style checks that the last parameter doesn't have braces
|
|
2346
|
-
# around it.
|
|
2347
|
-
- no_braces
|
|
2348
|
-
# The `context_dependent` style checks that the last parameter doesn't have
|
|
2349
|
-
# braces around it, but requires braces if the second to last parameter is
|
|
2350
|
-
# also a hash literal.
|
|
2351
|
-
- context_dependent
|
|
2363
|
+
# The BracesRequiredMethods overrides all other configurations except
|
|
2364
|
+
# IgnoredMethods. It can be used to enforce that all blocks for specific
|
|
2365
|
+
# methods use braces. For example, you can use this to enforce Sorbet
|
|
2366
|
+
# signatures use braces even when the rest of your codebase enforces
|
|
2367
|
+
# the `line_count_based` style.
|
|
2368
|
+
BracesRequiredMethods: []
|
|
2352
2369
|
|
|
2353
2370
|
Style/CaseEquality:
|
|
2354
2371
|
Description: 'Avoid explicit use of the case equality operator(===).'
|
|
@@ -2367,7 +2384,7 @@ Style/ClassAndModuleChildren:
|
|
|
2367
2384
|
StyleGuide: '#namespace-definition'
|
|
2368
2385
|
# Moving from compact to nested children requires knowledge of whether the
|
|
2369
2386
|
# outer parent is a module or a class. Moving from nested to compact requires
|
|
2370
|
-
# verification that the outer parent is defined elsewhere.
|
|
2387
|
+
# verification that the outer parent is defined elsewhere. RuboCop does not
|
|
2371
2388
|
# have the knowledge to perform either operation safely and thus requires
|
|
2372
2389
|
# manual oversight.
|
|
2373
2390
|
SafeAutoCorrect: false
|
|
@@ -2734,7 +2751,7 @@ Style/FrozenStringLiteralComment:
|
|
|
2734
2751
|
to help transition to frozen string literals by default.
|
|
2735
2752
|
Enabled: true
|
|
2736
2753
|
VersionAdded: '0.36'
|
|
2737
|
-
VersionChanged: '0.
|
|
2754
|
+
VersionChanged: '0.79'
|
|
2738
2755
|
EnforcedStyle: always
|
|
2739
2756
|
SupportedStyles:
|
|
2740
2757
|
# `always` will always add the frozen string literal comment to a file
|
|
@@ -2742,9 +2759,14 @@ Style/FrozenStringLiteralComment:
|
|
|
2742
2759
|
# string literal. If you run code against multiple versions of Ruby, it is
|
|
2743
2760
|
# possible that this will create errors in Ruby 2.3.0+.
|
|
2744
2761
|
- always
|
|
2762
|
+
# `always_true` will add the frozen string literal comment to a file,
|
|
2763
|
+
# similarly to the `always` style, but will also change any disabled
|
|
2764
|
+
# comments (e.g. `# frozen_string_literal: false`) to be enabled.
|
|
2765
|
+
- always_true
|
|
2745
2766
|
# `never` will enforce that the frozen string literal comment does not
|
|
2746
2767
|
# exist in a file.
|
|
2747
2768
|
- never
|
|
2769
|
+
Safe: false
|
|
2748
2770
|
|
|
2749
2771
|
Style/GlobalVars:
|
|
2750
2772
|
Description: 'Do not introduce global variables.'
|
|
@@ -2765,6 +2787,13 @@ Style/GuardClause:
|
|
|
2765
2787
|
# needs to have to trigger this cop
|
|
2766
2788
|
MinBodyLength: 1
|
|
2767
2789
|
|
|
2790
|
+
Style/HashEachMethods:
|
|
2791
|
+
Description: 'Use Hash#each_key and Hash#each_value.'
|
|
2792
|
+
StyleGuide: '#hash-each'
|
|
2793
|
+
Enabled: pending
|
|
2794
|
+
VersionAdded: '0.80'
|
|
2795
|
+
Safe: false
|
|
2796
|
+
|
|
2768
2797
|
Style/HashSyntax:
|
|
2769
2798
|
Description: >-
|
|
2770
2799
|
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
|
|
@@ -2788,6 +2817,18 @@ Style/HashSyntax:
|
|
|
2788
2817
|
# Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
|
|
2789
2818
|
PreferHashRocketsForNonAlnumEndingSymbols: false
|
|
2790
2819
|
|
|
2820
|
+
Style/HashTransformKeys:
|
|
2821
|
+
Description: 'Prefer `transform_keys` over `each_with_object` and `map`.'
|
|
2822
|
+
Enabled: 'pending'
|
|
2823
|
+
VersionAdded: '0.80'
|
|
2824
|
+
Safe: false
|
|
2825
|
+
|
|
2826
|
+
Style/HashTransformValues:
|
|
2827
|
+
Description: 'Prefer `transform_values` over `each_with_object` and `map`.'
|
|
2828
|
+
Enabled: 'pending'
|
|
2829
|
+
VersionAdded: '0.80'
|
|
2830
|
+
Safe: false
|
|
2831
|
+
|
|
2791
2832
|
Style/IdenticalConditionalBranches:
|
|
2792
2833
|
Description: >-
|
|
2793
2834
|
Checks that conditional statements do not have an identical
|
|
@@ -2874,8 +2915,9 @@ Style/IpAddresses:
|
|
|
2874
2915
|
Description: "Don't include literal IP addresses in code."
|
|
2875
2916
|
Enabled: false
|
|
2876
2917
|
VersionAdded: '0.58'
|
|
2877
|
-
|
|
2878
|
-
|
|
2918
|
+
VersionChanged: '0.77'
|
|
2919
|
+
# Allow addresses to be permitted
|
|
2920
|
+
AllowedAddresses:
|
|
2879
2921
|
- "::"
|
|
2880
2922
|
# :: is a valid IPv6 address, but could potentially be legitimately in code
|
|
2881
2923
|
|
|
@@ -3148,8 +3190,8 @@ Style/NestedParenthesizedCalls:
|
|
|
3148
3190
|
argument list of another parenthesized method call.
|
|
3149
3191
|
Enabled: true
|
|
3150
3192
|
VersionAdded: '0.36'
|
|
3151
|
-
VersionChanged: '0.
|
|
3152
|
-
|
|
3193
|
+
VersionChanged: '0.77'
|
|
3194
|
+
AllowedMethods:
|
|
3153
3195
|
- be
|
|
3154
3196
|
- be_a
|
|
3155
3197
|
- be_an
|
|
@@ -3402,6 +3444,16 @@ Style/RedundantBegin:
|
|
|
3402
3444
|
VersionAdded: '0.10'
|
|
3403
3445
|
VersionChanged: '0.21'
|
|
3404
3446
|
|
|
3447
|
+
Style/RedundantCapitalW:
|
|
3448
|
+
Description: 'Checks for %W when interpolation is not needed.'
|
|
3449
|
+
Enabled: true
|
|
3450
|
+
VersionAdded: '0.76'
|
|
3451
|
+
|
|
3452
|
+
Style/RedundantCondition:
|
|
3453
|
+
Description: 'Checks for unnecessary conditional expressions.'
|
|
3454
|
+
Enabled: true
|
|
3455
|
+
VersionAdded: '0.76'
|
|
3456
|
+
|
|
3405
3457
|
Style/RedundantConditional:
|
|
3406
3458
|
Description: "Don't return true/false from a conditional."
|
|
3407
3459
|
Enabled: true
|
|
@@ -3420,11 +3472,22 @@ Style/RedundantFreeze:
|
|
|
3420
3472
|
VersionAdded: '0.34'
|
|
3421
3473
|
VersionChanged: '0.66'
|
|
3422
3474
|
|
|
3475
|
+
Style/RedundantInterpolation:
|
|
3476
|
+
Description: 'Checks for strings that are just an interpolated expression.'
|
|
3477
|
+
Enabled: true
|
|
3478
|
+
VersionAdded: '0.76'
|
|
3479
|
+
|
|
3423
3480
|
Style/RedundantParentheses:
|
|
3424
3481
|
Description: "Checks for parentheses that seem not to serve any purpose."
|
|
3425
3482
|
Enabled: true
|
|
3426
3483
|
VersionAdded: '0.36'
|
|
3427
3484
|
|
|
3485
|
+
Style/RedundantPercentQ:
|
|
3486
|
+
Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
|
|
3487
|
+
StyleGuide: '#percent-q'
|
|
3488
|
+
Enabled: true
|
|
3489
|
+
VersionAdded: '0.76'
|
|
3490
|
+
|
|
3428
3491
|
Style/RedundantReturn:
|
|
3429
3492
|
Description: "Don't use return where it's not required."
|
|
3430
3493
|
StyleGuide: '#no-explicit-return'
|
|
@@ -3441,6 +3504,13 @@ Style/RedundantSelf:
|
|
|
3441
3504
|
VersionAdded: '0.10'
|
|
3442
3505
|
VersionChanged: '0.13'
|
|
3443
3506
|
|
|
3507
|
+
Style/RedundantSort:
|
|
3508
|
+
Description: >-
|
|
3509
|
+
Use `min` instead of `sort.first`,
|
|
3510
|
+
`max_by` instead of `sort_by...last`, etc.
|
|
3511
|
+
Enabled: true
|
|
3512
|
+
VersionAdded: '0.76'
|
|
3513
|
+
|
|
3444
3514
|
Style/RedundantSortBy:
|
|
3445
3515
|
Description: 'Use `sort` instead of `sort_by { |x| x }`.'
|
|
3446
3516
|
Enabled: true
|
|
@@ -3498,11 +3568,11 @@ Style/SafeNavigation:
|
|
|
3498
3568
|
safe navigation (`&.`).
|
|
3499
3569
|
Enabled: true
|
|
3500
3570
|
VersionAdded: '0.43'
|
|
3501
|
-
VersionChanged: '0.
|
|
3571
|
+
VersionChanged: '0.77'
|
|
3502
3572
|
# Safe navigation may cause a statement to start returning `nil` in addition
|
|
3503
3573
|
# to whatever it used to return.
|
|
3504
3574
|
ConvertCodeThatCanStartToReturnNil: false
|
|
3505
|
-
|
|
3575
|
+
AllowedMethods:
|
|
3506
3576
|
- present?
|
|
3507
3577
|
- blank?
|
|
3508
3578
|
- presence
|
|
@@ -3780,7 +3850,7 @@ Style/TrivialAccessors:
|
|
|
3780
3850
|
StyleGuide: '#attr_family'
|
|
3781
3851
|
Enabled: true
|
|
3782
3852
|
VersionAdded: '0.9'
|
|
3783
|
-
VersionChanged: '0.
|
|
3853
|
+
VersionChanged: '0.77'
|
|
3784
3854
|
# When set to `false` the cop will suggest the use of accessor methods
|
|
3785
3855
|
# in situations like:
|
|
3786
3856
|
#
|
|
@@ -3801,7 +3871,7 @@ Style/TrivialAccessors:
|
|
|
3801
3871
|
# Commonly used in DSLs
|
|
3802
3872
|
AllowDSLWriters: false
|
|
3803
3873
|
IgnoreClassMethods: false
|
|
3804
|
-
|
|
3874
|
+
AllowedMethods:
|
|
3805
3875
|
- to_ary
|
|
3806
3876
|
- to_a
|
|
3807
3877
|
- to_c
|
|
@@ -3828,35 +3898,6 @@ Style/UnlessElse:
|
|
|
3828
3898
|
Enabled: true
|
|
3829
3899
|
VersionAdded: '0.9'
|
|
3830
3900
|
|
|
3831
|
-
Style/UnneededCapitalW:
|
|
3832
|
-
Description: 'Checks for %W when interpolation is not needed.'
|
|
3833
|
-
Enabled: true
|
|
3834
|
-
VersionAdded: '0.21'
|
|
3835
|
-
VersionChanged: '0.24'
|
|
3836
|
-
|
|
3837
|
-
Style/UnneededCondition:
|
|
3838
|
-
Description: 'Checks for unnecessary conditional expressions.'
|
|
3839
|
-
Enabled: true
|
|
3840
|
-
VersionAdded: '0.57'
|
|
3841
|
-
|
|
3842
|
-
Style/UnneededInterpolation:
|
|
3843
|
-
Description: 'Checks for strings that are just an interpolated expression.'
|
|
3844
|
-
Enabled: true
|
|
3845
|
-
VersionAdded: '0.36'
|
|
3846
|
-
|
|
3847
|
-
Style/UnneededPercentQ:
|
|
3848
|
-
Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
|
|
3849
|
-
StyleGuide: '#percent-q'
|
|
3850
|
-
Enabled: true
|
|
3851
|
-
VersionAdded: '0.24'
|
|
3852
|
-
|
|
3853
|
-
Style/UnneededSort:
|
|
3854
|
-
Description: >-
|
|
3855
|
-
Use `min` instead of `sort.first`,
|
|
3856
|
-
`max_by` instead of `sort_by...last`, etc.
|
|
3857
|
-
Enabled: true
|
|
3858
|
-
VersionAdded: '0.55'
|
|
3859
|
-
|
|
3860
3901
|
Style/UnpackFirst:
|
|
3861
3902
|
Description: >-
|
|
3862
3903
|
Checks for accessing the first element of `String#unpack`
|