cookstyle 6.21.1 → 7.3.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -6
- data/config/cookstyle.yml +304 -249
- data/config/disable_all.yml +32 -0
- data/config/upstream.yml +271 -80
- data/lib/cookstyle/version.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/block_guard_clause_string_only.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/chef_application_fatal.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/conditional_ruby_shellout.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/dnf_package_allow_downgrades.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/incorrect_library_injection.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_default_action.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_notification_timing.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_platform_family_helper.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_platform_family_values_in_case.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_platform_helper.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_platform_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_platform_values_in_case.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_family_helper.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_helper.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_version_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/lazy_eval_node_attribute_defaults.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/lazy_in_resource_guard.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/macos_userdefaults_invalid_type.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/malformed_value_for_platform.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/metadata_missing_name.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/node_normal.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/node_normal_unless.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/node_save.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/notifies_action_not_symbol.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/octal_mode_as_string.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/openssl_password_helpers.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/powershell_delete_file.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/property_without_type.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/resource_sets_internal_properties.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/resource_sets_name_property.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/resource_with_none_action.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/scoped_file_exist.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/service_resource.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/supports_must_be_float.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/tmp_path.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/ use_automatic_resource_name.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/cb_depends_on_self.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chef_handler_recipe.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chef_handler_supports.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chef_rest.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chef_rewind.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chef_shellout.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chef_sugar_helpers.rb +56 -0
- data/lib/rubocop/cop/chef/deprecation/chef_windows_platform_helper.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chefdk_generators.rb +1 -1
- 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 -1
- data/lib/rubocop/cop/chef/deprecation/depends_poise.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_chefspec_platform.rb +3 -4
- data/lib/rubocop/cop/chef/deprecation/deprecated_mixins.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_platform_methods.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_shellout_methods.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_windows_version_check.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_yum_repository_actions.rb +67 -0
- data/lib/rubocop/cop/chef/deprecation/deprecated_yum_repository_properties.rb +1 -1
- 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/execute_path_property.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/execute_relative_creates_without_cwd.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/foodcritic_testing.rb +43 -0
- data/lib/rubocop/cop/chef/deprecation/hwrp_without_provides.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 -1
- 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/librarian_chefspec.rb +42 -0
- data/lib/rubocop/cop/chef/deprecation/locale_lc_all_property.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/log_resource_notifications.rb +3 -3
- data/lib/rubocop/cop/chef/deprecation/macos_userdefaults_global_property.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/name_property_and_default.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/node_deep_fetch.rb +1 -1
- 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 +1 -1
- 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 +1 -1
- data/lib/rubocop/cop/chef/deprecation/powershell_cookbook_helpers.rb +1 -1
- 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_only_resource_name.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/ruby_27_keyword_argument_warnings.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/ruby_block_create_action.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/run_command_helper.rb +1 -1
- 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/use_yaml_dump.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 -1
- data/lib/rubocop/cop/chef/deprecation/windows_feature_servermanagercmd.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/windows_package_installer_type_string.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/windows_task_change_action.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/windows_version_helpers.rb +1 -1
- 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/effortless/berksfile.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/chef_vault_used.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/data_bags.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/depends_chef_vault.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/node_environment.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/node_policygroup.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/node_roles.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/search_for_environments_or_roles.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/search_used.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/action_method_in_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/allowed_actions_initializer.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/apt_default_recipe.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/berksfile_source.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/build_essential.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/chef_14_resources.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/chef_gem_nokogiri.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/compile_time_resources.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/conditional_using_test.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/cron_d_file_or_template.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/cron_manage_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/databag_helpers.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/default_action_initializer.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/defines_chefspec_matchers.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/definitions.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/depends_zypper_cookbook.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/dsl_include_in_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/empty_resource_initialize.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/execute_apt_update.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/execute_sc_exe.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/execute_sleep.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/execute_sysctl.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/execute_tzutil.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/foodcritic_comments.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/if_provides_default_action.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/includes_mixin_shellout.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/libarchive_file.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/macos_user_defaults.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/minitest_handler_usage.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/node_init_package.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/node_roles_include.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/ohai_default_recipe.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/openssl_rsa_key_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/openssl_x509_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/osx_config_profile_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/powershell_expand_archive.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/powershell_guard_interpreter.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/powershell_install_package.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/powershell_install_windowsfeature.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/property_with_name_attribute.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/provides_initializer.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/resource_name_initializer.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/resource_set_or_return.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/resource_with_attributes.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/respond_to_compile_time.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/respond_to_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/respond_to_provides.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/respond_to_resource_name.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/sc_windows_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/seven_zip_archive.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/shell_out_helper.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/shellouts_to_chocolatey.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/simplify_apt_ppa_setup.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/sysctl_param_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/unnecessary_mixlib_shellout_require.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/use_multipackage_installs.rb +17 -13
- data/lib/rubocop/cop/chef/modernize/use_require_relative.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/whyrun_supported_true.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/windows_default_recipe.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/windows_registry_uac.rb +4 -4
- data/lib/rubocop/cop/chef/modernize/windows_zipfile.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/zipfile_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/zypper_repo.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/apt_repository_distribution_default.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/apt_repository_notifies_apt_update.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/attribute_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/conflicts_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/custom_resource_with_allowed_actions.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/double_compile_time.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/grouping_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/long_description_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/multiple_platform_checks.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/name_property_and_required.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/ohai_attribute_to_string.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/property_splat_regex.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/property_with_default_and_required.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/provides_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/recipe_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/replaces_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/resource_with_nothing_action.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/sensitive_property_in_resource.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/string_property_with_nil_default.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/suggests_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/unnecessary_desired_state.rb +13 -12
- data/lib/rubocop/cop/chef/redundant/unnecessary_name_property.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/use_create_if_missing.rb +1 -1
- data/lib/rubocop/cop/chef/sharing/default_maintainer_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/sharing/empty_metadata_field.rb +1 -1
- data/lib/rubocop/cop/chef/sharing/include_property_descriptions.rb +1 -1
- data/lib/rubocop/cop/chef/sharing/include_resource_descriptions.rb +1 -1
- data/lib/rubocop/cop/chef/sharing/include_resource_examples.rb +1 -1
- data/lib/rubocop/cop/chef/sharing/insecure_cookbook_url.rb +1 -1
- data/lib/rubocop/cop/chef/sharing/invalid_license_string.rb +1 -1
- data/lib/rubocop/cop/chef/style/attribute_keys.rb +1 -1
- data/lib/rubocop/cop/chef/style/chef_whaaat.rb +1 -1
- data/lib/rubocop/cop/chef/style/comment_sentence_spacing.rb +2 -2
- data/lib/rubocop/cop/chef/style/comments_copyright_format.rb +4 -3
- data/lib/rubocop/cop/chef/style/comments_default_copyright.rb +1 -1
- data/lib/rubocop/cop/chef/style/comments_format.rb +1 -1
- data/lib/rubocop/cop/chef/style/file_mode.rb +1 -1
- data/lib/rubocop/cop/chef/style/immediate_notification_timing.rb +1 -1
- data/lib/rubocop/cop/chef/style/include_recipe_with_parentheses.rb +1 -1
- data/lib/rubocop/cop/chef/style/negating_only_if.rb +1 -1
- data/lib/rubocop/cop/chef/style/overly_complex_supports_depends_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/style/simplify_platform_major_version_check.rb +1 -1
- data/lib/rubocop/cop/chef/style/true_false_resource_properties.rb +1 -1
- data/lib/rubocop/cop/chef/style/unnecessary_os_check.rb +1 -1
- data/lib/rubocop/cop/chef/style/unnecessary_platform_case_statement.rb +1 -1
- data/lib/rubocop/cop/chef/style/use_platform_helpers.rb +1 -1
- data/lib/rubocop/monkey_patches/comment_config.rb +1 -1
- metadata +8 -4
data/config/disable_all.yml
CHANGED
@@ -229,6 +229,8 @@ Lint/DeprecatedOpenSSLConstant:
|
|
229
229
|
Enabled: false
|
230
230
|
Lint/DisjunctiveAssignmentInConstructor:
|
231
231
|
Enabled: false
|
232
|
+
Lint/DuplicateBranch:
|
233
|
+
Enabled: false
|
232
234
|
Lint/DuplicateCaseCondition:
|
233
235
|
Enabled: false
|
234
236
|
Lint/DuplicateElsifCondition:
|
@@ -237,6 +239,8 @@ Lint/DuplicateHashKey:
|
|
237
239
|
Enabled: false
|
238
240
|
Lint/DuplicateMethods:
|
239
241
|
Enabled: false
|
242
|
+
Lint/DuplicateRegexpCharacterClassElement:
|
243
|
+
Enabled: false
|
240
244
|
Lint/DuplicateRequire:
|
241
245
|
Enabled: false
|
242
246
|
Lint/DuplicateRescueException:
|
@@ -245,6 +249,10 @@ Lint/EachWithObjectArgument:
|
|
245
249
|
Enabled: false
|
246
250
|
Lint/ElseLayout:
|
247
251
|
Enabled: false
|
252
|
+
Lint/EmptyBlock:
|
253
|
+
Enabled: false
|
254
|
+
Lint/EmptyClass:
|
255
|
+
Enabled: false
|
248
256
|
Lint/EmptyConditionalBody:
|
249
257
|
Enabled: false
|
250
258
|
Lint/EmptyEnsure:
|
@@ -303,6 +311,8 @@ Lint/NestedPercentLiteral:
|
|
303
311
|
Enabled: false
|
304
312
|
Lint/NextWithoutAccumulator:
|
305
313
|
Enabled: false
|
314
|
+
Lint/NoReturnInBeginEndBlocks:
|
315
|
+
Enabled: false
|
306
316
|
Lint/NonDeterministicRequireOrder:
|
307
317
|
Enabled: false
|
308
318
|
Lint/NonLocalExitFromIterator:
|
@@ -373,6 +383,8 @@ Lint/SuppressedException:
|
|
373
383
|
Enabled: false
|
374
384
|
Lint/Syntax:
|
375
385
|
Enabled: false
|
386
|
+
Lint/ToEnumArguments:
|
387
|
+
Enabled: false
|
376
388
|
Lint/ToJSON:
|
377
389
|
Enabled: false
|
378
390
|
Lint/TopLevelReturnWithArgument:
|
@@ -381,8 +393,12 @@ Lint/TrailingCommaInAttributeDeclaration:
|
|
381
393
|
Enabled: false
|
382
394
|
Lint/UnderscorePrefixedVariableName:
|
383
395
|
Enabled: false
|
396
|
+
Lint/UnexpectedBlockArity:
|
397
|
+
Enabled: false
|
384
398
|
Lint/UnifiedInteger:
|
385
399
|
Enabled: false
|
400
|
+
Lint/UnmodifiedReduceAccumulator:
|
401
|
+
Enabled: false
|
386
402
|
Lint/UnreachableCode:
|
387
403
|
Enabled: false
|
388
404
|
Lint/UnreachableLoop:
|
@@ -467,6 +483,8 @@ Style/Alias:
|
|
467
483
|
Enabled: false
|
468
484
|
Style/AndOr:
|
469
485
|
Enabled: false
|
486
|
+
Style/ArgumentsForwarding:
|
487
|
+
Enabled: false
|
470
488
|
Style/ArrayCoercion:
|
471
489
|
Enabled: false
|
472
490
|
Style/ArrayJoin:
|
@@ -505,6 +523,8 @@ Style/ClassMethodsDefinitions:
|
|
505
523
|
Enabled: false
|
506
524
|
Style/ClassVars:
|
507
525
|
Enabled: false
|
526
|
+
Style/CollectionCompact:
|
527
|
+
Enabled: false
|
508
528
|
Style/CollectionMethods:
|
509
529
|
Enabled: false
|
510
530
|
Style/ColonMethodCall:
|
@@ -537,6 +557,8 @@ Style/DocumentationMethod:
|
|
537
557
|
Enabled: false
|
538
558
|
Style/Documentation:
|
539
559
|
Enabled: false
|
560
|
+
Style/DocumentDynamicEvalDefinition:
|
561
|
+
Enabled: false
|
540
562
|
Style/DoubleCopDisableDirective:
|
541
563
|
Enabled: false
|
542
564
|
Style/DoubleNegation:
|
@@ -641,6 +663,8 @@ Style/RedundantSelfAssignment:
|
|
641
663
|
Enabled: false
|
642
664
|
Style/SoleNestedConditional:
|
643
665
|
Enabled: false
|
666
|
+
Style/StaticClass:
|
667
|
+
Enabled: false
|
644
668
|
Style/MethodCalledOnDoEndBlock:
|
645
669
|
Enabled: false
|
646
670
|
Style/MethodDefParentheses:
|
@@ -677,6 +701,8 @@ Style/MutableConstant:
|
|
677
701
|
Enabled: false
|
678
702
|
Style/NegatedIf:
|
679
703
|
Enabled: false
|
704
|
+
Style/NegatedIfElseCondition:
|
705
|
+
Enabled: false
|
680
706
|
Style/NegatedUnless:
|
681
707
|
Enabled: false
|
682
708
|
Style/NegatedWhile:
|
@@ -691,6 +717,8 @@ Style/Next:
|
|
691
717
|
Enabled: false
|
692
718
|
Style/NilComparison:
|
693
719
|
Enabled: false
|
720
|
+
Style/NilLambda:
|
721
|
+
Enabled: false
|
694
722
|
Style/NonNilCheck:
|
695
723
|
Enabled: false
|
696
724
|
Style/Not:
|
@@ -729,6 +757,8 @@ Style/RaiseArgs:
|
|
729
757
|
Enabled: false
|
730
758
|
Style/RandomWithOffset:
|
731
759
|
Enabled: false
|
760
|
+
Style/RedundantArgument:
|
761
|
+
Enabled: false
|
732
762
|
Style/RedundantBegin:
|
733
763
|
Enabled: false
|
734
764
|
Style/RedundantCapitalW:
|
@@ -807,6 +837,8 @@ Style/Strip:
|
|
807
837
|
Enabled: false
|
808
838
|
Style/StructInheritance:
|
809
839
|
Enabled: false
|
840
|
+
Style/SwapValues:
|
841
|
+
Enabled: false
|
810
842
|
Style/SymbolArray:
|
811
843
|
Enabled: false
|
812
844
|
Style/SymbolLiteral:
|
data/config/upstream.yml
CHANGED
@@ -139,6 +139,16 @@ AllCops:
|
|
139
139
|
# from the lock file.) If the Ruby version is still unresolved, RuboCop will
|
140
140
|
# use the oldest officially supported Ruby version (currently Ruby 2.4).
|
141
141
|
TargetRubyVersion: ~
|
142
|
+
# Determines if a notification for extension libraries should be shown when
|
143
|
+
# rubocop is run. Keys are the name of the extension, and values are an array
|
144
|
+
# of gems in the Gemfile that the extension is suggested for, if not already
|
145
|
+
# included.
|
146
|
+
SuggestExtensions:
|
147
|
+
rubocop-rails: [rails]
|
148
|
+
rubocop-rspec: [rspec, rspec-rails]
|
149
|
+
rubocop-minitest: [minitest]
|
150
|
+
rubocop-sequel: [sequel]
|
151
|
+
rubocop-rake: [rake]
|
142
152
|
|
143
153
|
#################### Bundler ###############################
|
144
154
|
|
@@ -313,7 +323,7 @@ Layout/AssignmentIndentation:
|
|
313
323
|
|
314
324
|
Layout/BeginEndAlignment:
|
315
325
|
Description: 'Align ends corresponding to begins correctly.'
|
316
|
-
Enabled:
|
326
|
+
Enabled: true
|
317
327
|
VersionAdded: '0.91'
|
318
328
|
# The value `start_of_line` means that `end` should be aligned the start of the line
|
319
329
|
# where the `begin` keyword is.
|
@@ -459,10 +469,14 @@ Layout/EmptyLineAfterMultilineCondition:
|
|
459
469
|
- https://github.com/airbnb/ruby#multiline-if-newline
|
460
470
|
|
461
471
|
Layout/EmptyLineBetweenDefs:
|
462
|
-
Description: 'Use empty lines between defs.'
|
472
|
+
Description: 'Use empty lines between class/module/method defs.'
|
463
473
|
StyleGuide: '#empty-lines-between-methods'
|
464
474
|
Enabled: true
|
465
475
|
VersionAdded: '0.49'
|
476
|
+
VersionChanged: '1.4'
|
477
|
+
EmptyLineBetweenMethodDefs: true
|
478
|
+
EmptyLineBetweenClassDefs: true
|
479
|
+
EmptyLineBetweenModuleDefs: true
|
466
480
|
# If `true`, this parameter means that single line method definitions don't
|
467
481
|
# need an empty line between them.
|
468
482
|
AllowAdjacentOneLineDefs: false
|
@@ -496,7 +510,7 @@ Layout/EmptyLinesAroundArguments:
|
|
496
510
|
Layout/EmptyLinesAroundAttributeAccessor:
|
497
511
|
Description: "Keep blank lines around attribute accessors."
|
498
512
|
StyleGuide: '#empty-lines-around-attribute-accessor'
|
499
|
-
Enabled:
|
513
|
+
Enabled: true
|
500
514
|
VersionAdded: '0.83'
|
501
515
|
VersionChanged: '0.84'
|
502
516
|
AllowAliasSyntax: true
|
@@ -891,8 +905,8 @@ Layout/LineLength:
|
|
891
905
|
StyleGuide: '#max-line-length'
|
892
906
|
Enabled: true
|
893
907
|
VersionAdded: '0.25'
|
894
|
-
VersionChanged: '
|
895
|
-
AutoCorrect:
|
908
|
+
VersionChanged: '1.4'
|
909
|
+
AutoCorrect: true
|
896
910
|
Max: 120
|
897
911
|
# To make it possible to copy or click on URIs in the code, we allow lines
|
898
912
|
# containing a URI to be longer than Max.
|
@@ -1145,7 +1159,7 @@ Layout/SpaceAroundKeyword:
|
|
1145
1159
|
|
1146
1160
|
Layout/SpaceAroundMethodCallOperator:
|
1147
1161
|
Description: 'Checks method call operators to not have spaces around them.'
|
1148
|
-
Enabled:
|
1162
|
+
Enabled: true
|
1149
1163
|
VersionAdded: '0.82'
|
1150
1164
|
|
1151
1165
|
Layout/SpaceAroundOperators:
|
@@ -1176,7 +1190,7 @@ Layout/SpaceBeforeBlockBraces:
|
|
1176
1190
|
SupportedStylesForEmptyBraces:
|
1177
1191
|
- space
|
1178
1192
|
- no_space
|
1179
|
-
VersionChanged: '0.52
|
1193
|
+
VersionChanged: '0.52'
|
1180
1194
|
|
1181
1195
|
Layout/SpaceBeforeComma:
|
1182
1196
|
Description: 'No spaces before commas.'
|
@@ -1334,8 +1348,8 @@ Layout/TrailingWhitespace:
|
|
1334
1348
|
StyleGuide: '#no-trailing-whitespace'
|
1335
1349
|
Enabled: true
|
1336
1350
|
VersionAdded: '0.49'
|
1337
|
-
VersionChanged: '0
|
1338
|
-
AllowInHeredoc:
|
1351
|
+
VersionChanged: '1.0'
|
1352
|
+
AllowInHeredoc: false
|
1339
1353
|
|
1340
1354
|
#################### Lint ##################################
|
1341
1355
|
### Warnings
|
@@ -1379,7 +1393,7 @@ Lint/BigDecimalNew:
|
|
1379
1393
|
|
1380
1394
|
Lint/BinaryOperatorWithIdenticalOperands:
|
1381
1395
|
Description: 'This cop checks for places where binary operator has identical operands.'
|
1382
|
-
Enabled:
|
1396
|
+
Enabled: true
|
1383
1397
|
Safe: false
|
1384
1398
|
VersionAdded: '0.89'
|
1385
1399
|
|
@@ -1398,8 +1412,13 @@ Lint/CircularArgumentReference:
|
|
1398
1412
|
Lint/ConstantDefinitionInBlock:
|
1399
1413
|
Description: 'Do not define constants within a block.'
|
1400
1414
|
StyleGuide: '#no-constant-definition-in-block'
|
1401
|
-
Enabled:
|
1415
|
+
Enabled: true
|
1402
1416
|
VersionAdded: '0.91'
|
1417
|
+
VersionChanged: '1.3'
|
1418
|
+
# `enums` for Typed Enums via T::Enum in Sorbet.
|
1419
|
+
# https://sorbet.org/docs/tenum
|
1420
|
+
AllowedMethods:
|
1421
|
+
- enums
|
1403
1422
|
|
1404
1423
|
Lint/ConstantResolution:
|
1405
1424
|
Description: 'Check that constants are fully qualified with `::`.'
|
@@ -1415,6 +1434,22 @@ Lint/Debugger:
|
|
1415
1434
|
Enabled: true
|
1416
1435
|
VersionAdded: '0.14'
|
1417
1436
|
VersionChanged: '0.49'
|
1437
|
+
DebuggerReceivers:
|
1438
|
+
- binding
|
1439
|
+
- Kernel
|
1440
|
+
- Pry
|
1441
|
+
DebuggerMethods:
|
1442
|
+
- debugger
|
1443
|
+
- byebug
|
1444
|
+
- remote_byebug
|
1445
|
+
- pry
|
1446
|
+
- remote_pry
|
1447
|
+
- pry_remote
|
1448
|
+
- console
|
1449
|
+
- rescue
|
1450
|
+
- save_and_open_page
|
1451
|
+
- save_and_open_screenshot
|
1452
|
+
- irb
|
1418
1453
|
|
1419
1454
|
Lint/DeprecatedClassMethods:
|
1420
1455
|
Description: 'Check for deprecated class method calls.'
|
@@ -1423,7 +1458,7 @@ Lint/DeprecatedClassMethods:
|
|
1423
1458
|
|
1424
1459
|
Lint/DeprecatedOpenSSLConstant:
|
1425
1460
|
Description: "Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`."
|
1426
|
-
Enabled:
|
1461
|
+
Enabled: true
|
1427
1462
|
VersionAdded: '0.84'
|
1428
1463
|
|
1429
1464
|
Lint/DisjunctiveAssignmentInConstructor:
|
@@ -1433,6 +1468,11 @@ Lint/DisjunctiveAssignmentInConstructor:
|
|
1433
1468
|
VersionAdded: '0.62'
|
1434
1469
|
VersionChanged: '0.88'
|
1435
1470
|
|
1471
|
+
Lint/DuplicateBranch:
|
1472
|
+
Description: Checks that there are no repeated bodies within `if/unless`, `case-when` and `rescue` constructs.
|
1473
|
+
Enabled: pending
|
1474
|
+
VersionAdded: '1.3'
|
1475
|
+
|
1436
1476
|
Lint/DuplicateCaseCondition:
|
1437
1477
|
Description: 'Do not repeat values in case conditionals.'
|
1438
1478
|
Enabled: true
|
@@ -1440,7 +1480,7 @@ Lint/DuplicateCaseCondition:
|
|
1440
1480
|
|
1441
1481
|
Lint/DuplicateElsifCondition:
|
1442
1482
|
Description: 'Do not repeat conditions used in if `elsif`.'
|
1443
|
-
Enabled:
|
1483
|
+
Enabled: true
|
1444
1484
|
VersionAdded: '0.88'
|
1445
1485
|
|
1446
1486
|
Lint/DuplicateHashKey:
|
@@ -1454,14 +1494,19 @@ Lint/DuplicateMethods:
|
|
1454
1494
|
Enabled: true
|
1455
1495
|
VersionAdded: '0.29'
|
1456
1496
|
|
1497
|
+
Lint/DuplicateRegexpCharacterClassElement:
|
1498
|
+
Description: 'Checks for duplicate elements in Regexp character classes.'
|
1499
|
+
Enabled: pending
|
1500
|
+
VersionAdded: '1.1'
|
1501
|
+
|
1457
1502
|
Lint/DuplicateRequire:
|
1458
1503
|
Description: 'Check for duplicate `require`s and `require_relative`s.'
|
1459
|
-
Enabled:
|
1504
|
+
Enabled: true
|
1460
1505
|
VersionAdded: '0.90'
|
1461
1506
|
|
1462
1507
|
Lint/DuplicateRescueException:
|
1463
1508
|
Description: 'Checks that there are no repeated exceptions used in `rescue` expressions.'
|
1464
|
-
Enabled:
|
1509
|
+
Enabled: true
|
1465
1510
|
VersionAdded: '0.89'
|
1466
1511
|
|
1467
1512
|
Lint/EachWithObjectArgument:
|
@@ -1473,10 +1518,25 @@ Lint/ElseLayout:
|
|
1473
1518
|
Description: 'Check for odd code arrangement in an else block.'
|
1474
1519
|
Enabled: true
|
1475
1520
|
VersionAdded: '0.17'
|
1521
|
+
VersionChanged: '1.2'
|
1522
|
+
|
1523
|
+
Lint/EmptyBlock:
|
1524
|
+
Description: 'This cop checks for blocks without a body.'
|
1525
|
+
Enabled: pending
|
1526
|
+
VersionAdded: '1.1'
|
1527
|
+
VersionChanged: '1.3'
|
1528
|
+
AllowComments: true
|
1529
|
+
AllowEmptyLambdas: true
|
1530
|
+
|
1531
|
+
Lint/EmptyClass:
|
1532
|
+
Description: 'Checks for classes and metaclasses without a body.'
|
1533
|
+
Enabled: pending
|
1534
|
+
VersionAdded: '1.3'
|
1535
|
+
AllowComments: false
|
1476
1536
|
|
1477
1537
|
Lint/EmptyConditionalBody:
|
1478
1538
|
Description: 'This cop checks for the presence of `if`, `elsif` and `unless` branches without a body.'
|
1479
|
-
Enabled:
|
1539
|
+
Enabled: true
|
1480
1540
|
AllowComments: true
|
1481
1541
|
VersionAdded: '0.89'
|
1482
1542
|
|
@@ -1493,7 +1553,7 @@ Lint/EmptyExpression:
|
|
1493
1553
|
|
1494
1554
|
Lint/EmptyFile:
|
1495
1555
|
Description: 'Enforces that Ruby source files are not empty.'
|
1496
|
-
Enabled:
|
1556
|
+
Enabled: true
|
1497
1557
|
AllowComments: true
|
1498
1558
|
VersionAdded: '0.90'
|
1499
1559
|
|
@@ -1531,7 +1591,7 @@ Lint/FlipFlop:
|
|
1531
1591
|
Lint/FloatComparison:
|
1532
1592
|
Description: 'Checks for the presence of precise comparison of floating point numbers.'
|
1533
1593
|
StyleGuide: '#float-comparison'
|
1534
|
-
Enabled:
|
1594
|
+
Enabled: true
|
1535
1595
|
VersionAdded: '0.89'
|
1536
1596
|
|
1537
1597
|
Lint/FloatOutOfRange:
|
@@ -1549,7 +1609,7 @@ Lint/FormatParameterMismatch:
|
|
1549
1609
|
Lint/HashCompareByIdentity:
|
1550
1610
|
Description: 'Prefer using `Hash#compare_by_identity` than using `object_id` for keys.'
|
1551
1611
|
StyleGuide: '#identity-comparison'
|
1552
|
-
Enabled:
|
1612
|
+
Enabled: true
|
1553
1613
|
Safe: false
|
1554
1614
|
VersionAdded: '0.93'
|
1555
1615
|
|
@@ -1563,7 +1623,7 @@ Lint/HeredocMethodCallPosition:
|
|
1563
1623
|
|
1564
1624
|
Lint/IdentityComparison:
|
1565
1625
|
Description: 'Prefer `equal?` over `==` when comparing `object_id`.'
|
1566
|
-
Enabled:
|
1626
|
+
Enabled: true
|
1567
1627
|
StyleGuide: '#identity-comparison'
|
1568
1628
|
VersionAdded: '0.91'
|
1569
1629
|
|
@@ -1616,7 +1676,8 @@ Lint/Loop:
|
|
1616
1676
|
StyleGuide: '#loop-with-break'
|
1617
1677
|
Enabled: true
|
1618
1678
|
VersionAdded: '0.9'
|
1619
|
-
VersionChanged: '
|
1679
|
+
VersionChanged: '1.3'
|
1680
|
+
Safe: false
|
1620
1681
|
|
1621
1682
|
Lint/MissingCopEnableDirective:
|
1622
1683
|
Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`.'
|
@@ -1635,19 +1696,21 @@ Lint/MissingSuper:
|
|
1635
1696
|
Description: >-
|
1636
1697
|
This cop checks for the presence of constructors and lifecycle callbacks
|
1637
1698
|
without calls to `super`'.
|
1638
|
-
Enabled:
|
1699
|
+
Enabled: true
|
1639
1700
|
VersionAdded: '0.89'
|
1701
|
+
VersionChanged: '1.4'
|
1640
1702
|
|
1641
1703
|
Lint/MixedRegexpCaptureTypes:
|
1642
1704
|
Description: 'Do not mix named captures and numbered captures in a Regexp literal.'
|
1643
|
-
Enabled:
|
1705
|
+
Enabled: true
|
1644
1706
|
VersionAdded: '0.85'
|
1645
1707
|
|
1646
1708
|
Lint/MultipleComparison:
|
1647
1709
|
Description: "Use `&&` operator to compare multiple values."
|
1648
1710
|
Enabled: true
|
1649
1711
|
VersionAdded: '0.47'
|
1650
|
-
VersionChanged: '
|
1712
|
+
VersionChanged: '1.1'
|
1713
|
+
AllowMethodComparison: true
|
1651
1714
|
|
1652
1715
|
Lint/NestedMethodDefinition:
|
1653
1716
|
Description: 'Do not use nested method definitions.'
|
@@ -1667,6 +1730,11 @@ Lint/NextWithoutAccumulator:
|
|
1667
1730
|
Enabled: true
|
1668
1731
|
VersionAdded: '0.36'
|
1669
1732
|
|
1733
|
+
Lint/NoReturnInBeginEndBlocks:
|
1734
|
+
Description: 'Do not `return` inside `begin..end` blocks in assignment contexts.'
|
1735
|
+
Enabled: pending
|
1736
|
+
VersionAdded: '1.2'
|
1737
|
+
|
1670
1738
|
Lint/NonDeterministicRequireOrder:
|
1671
1739
|
Description: 'Always sort arrays returned by Dir.glob when requiring files.'
|
1672
1740
|
Enabled: true
|
@@ -1682,8 +1750,12 @@ Lint/NumberConversion:
|
|
1682
1750
|
Description: 'Checks unsafe usage of number conversion methods.'
|
1683
1751
|
Enabled: false
|
1684
1752
|
VersionAdded: '0.53'
|
1685
|
-
VersionChanged: '
|
1753
|
+
VersionChanged: '1.1'
|
1686
1754
|
SafeAutoCorrect: false
|
1755
|
+
IgnoredMethods: []
|
1756
|
+
IgnoredClasses:
|
1757
|
+
- Time
|
1758
|
+
- DateTime
|
1687
1759
|
|
1688
1760
|
Lint/OrderedMagicComments:
|
1689
1761
|
Description: 'Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang.'
|
@@ -1692,7 +1764,7 @@ Lint/OrderedMagicComments:
|
|
1692
1764
|
|
1693
1765
|
Lint/OutOfRangeRegexpRef:
|
1694
1766
|
Description: 'Checks for out of range reference for Regexp because it always returns nil.'
|
1695
|
-
Enabled:
|
1767
|
+
Enabled: true
|
1696
1768
|
Safe: false
|
1697
1769
|
VersionAdded: '0.89'
|
1698
1770
|
|
@@ -1721,7 +1793,7 @@ Lint/PercentSymbolArray:
|
|
1721
1793
|
Lint/RaiseException:
|
1722
1794
|
Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
|
1723
1795
|
StyleGuide: '#raise-exception'
|
1724
|
-
Enabled:
|
1796
|
+
Enabled: true
|
1725
1797
|
Safe: false
|
1726
1798
|
VersionAdded: '0.81'
|
1727
1799
|
VersionChanged: '0.86'
|
@@ -1755,7 +1827,7 @@ Lint/RedundantRequireStatement:
|
|
1755
1827
|
|
1756
1828
|
Lint/RedundantSafeNavigation:
|
1757
1829
|
Description: 'Checks for redundant safe navigation calls.'
|
1758
|
-
Enabled:
|
1830
|
+
Enabled: true
|
1759
1831
|
VersionAdded: '0.93'
|
1760
1832
|
AllowedMethods:
|
1761
1833
|
- instance_of?
|
@@ -1808,7 +1880,7 @@ Lint/RescueException:
|
|
1808
1880
|
StyleGuide: '#no-blind-rescues'
|
1809
1881
|
Enabled: true
|
1810
1882
|
VersionAdded: '0.9'
|
1811
|
-
VersionChanged: '0.27
|
1883
|
+
VersionChanged: '0.27'
|
1812
1884
|
|
1813
1885
|
Lint/RescueType:
|
1814
1886
|
Description: 'Avoid rescuing from non constants that could result in a `TypeError`.'
|
@@ -1862,7 +1934,7 @@ Lint/ScriptPermission:
|
|
1862
1934
|
|
1863
1935
|
Lint/SelfAssignment:
|
1864
1936
|
Description: 'Checks for self-assignments.'
|
1865
|
-
Enabled:
|
1937
|
+
Enabled: true
|
1866
1938
|
VersionAdded: '0.89'
|
1867
1939
|
|
1868
1940
|
Lint/SendWithMixinArgument:
|
@@ -1893,7 +1965,7 @@ Lint/ShadowingOuterLocalVariable:
|
|
1893
1965
|
|
1894
1966
|
Lint/StructNewOverride:
|
1895
1967
|
Description: 'Disallow overriding the `Struct` built-in methods via `Struct.new`.'
|
1896
|
-
Enabled:
|
1968
|
+
Enabled: true
|
1897
1969
|
VersionAdded: '0.81'
|
1898
1970
|
|
1899
1971
|
Lint/SuppressedException:
|
@@ -1910,6 +1982,11 @@ Lint/Syntax:
|
|
1910
1982
|
VersionAdded: '0.9'
|
1911
1983
|
|
1912
1984
|
|
1985
|
+
Lint/ToEnumArguments:
|
1986
|
+
Description: 'This cop ensures that `to_enum`/`enum_for`, called for the current method, has correct arguments.'
|
1987
|
+
Enabled: pending
|
1988
|
+
VersionAdded: '1.1'
|
1989
|
+
|
1913
1990
|
Lint/ToJSON:
|
1914
1991
|
Description: 'Ensure #to_json includes an optional argument.'
|
1915
1992
|
Enabled: true
|
@@ -1917,12 +1994,12 @@ Lint/ToJSON:
|
|
1917
1994
|
|
1918
1995
|
Lint/TopLevelReturnWithArgument:
|
1919
1996
|
Description: 'This cop detects top level return statements with argument.'
|
1920
|
-
Enabled:
|
1997
|
+
Enabled: true
|
1921
1998
|
VersionAdded: '0.89'
|
1922
1999
|
|
1923
2000
|
Lint/TrailingCommaInAttributeDeclaration:
|
1924
2001
|
Description: 'This cop checks for trailing commas in attribute declarations.'
|
1925
|
-
Enabled:
|
2002
|
+
Enabled: true
|
1926
2003
|
VersionAdded: '0.90'
|
1927
2004
|
|
1928
2005
|
Lint/UnderscorePrefixedVariableName:
|
@@ -1931,11 +2008,34 @@ Lint/UnderscorePrefixedVariableName:
|
|
1931
2008
|
VersionAdded: '0.21'
|
1932
2009
|
AllowKeywordBlockArguments: false
|
1933
2010
|
|
2011
|
+
Lint/UnexpectedBlockArity:
|
2012
|
+
Description: 'Looks for blocks that have fewer arguments that the calling method expects.'
|
2013
|
+
Enabled: pending
|
2014
|
+
Safe: false
|
2015
|
+
VersionAdded: '1.5'
|
2016
|
+
Methods:
|
2017
|
+
chunk_while: 2
|
2018
|
+
each_with_index: 2
|
2019
|
+
each_with_object: 2
|
2020
|
+
inject: 2
|
2021
|
+
max: 2
|
2022
|
+
min: 2
|
2023
|
+
minmax: 2
|
2024
|
+
reduce: 2
|
2025
|
+
slice_when: 2
|
2026
|
+
sort: 2
|
2027
|
+
|
1934
2028
|
Lint/UnifiedInteger:
|
1935
2029
|
Description: 'Use Integer instead of Fixnum or Bignum.'
|
1936
2030
|
Enabled: true
|
1937
2031
|
VersionAdded: '0.43'
|
1938
2032
|
|
2033
|
+
Lint/UnmodifiedReduceAccumulator:
|
2034
|
+
Description: Checks for `reduce` or `inject` blocks that do not update the accumulator each iteration.
|
2035
|
+
Enabled: pending
|
2036
|
+
VersionAdded: '1.1'
|
2037
|
+
VersionChanged: '1.5'
|
2038
|
+
|
1939
2039
|
Lint/UnreachableCode:
|
1940
2040
|
Description: 'Unreachable code.'
|
1941
2041
|
Enabled: true
|
@@ -1943,7 +2043,7 @@ Lint/UnreachableCode:
|
|
1943
2043
|
|
1944
2044
|
Lint/UnreachableLoop:
|
1945
2045
|
Description: 'This cop checks for loops that will have at most one iteration.'
|
1946
|
-
Enabled:
|
2046
|
+
Enabled: true
|
1947
2047
|
VersionAdded: '0.89'
|
1948
2048
|
|
1949
2049
|
Lint/UnusedBlockArgument:
|
@@ -2002,7 +2102,7 @@ Lint/UselessElseWithoutRescue:
|
|
2002
2102
|
|
2003
2103
|
Lint/UselessMethodDefinition:
|
2004
2104
|
Description: 'Checks for useless method definitions.'
|
2005
|
-
Enabled:
|
2105
|
+
Enabled: true
|
2006
2106
|
VersionAdded: '0.90'
|
2007
2107
|
Safe: false
|
2008
2108
|
AllowComments: true
|
@@ -2010,13 +2110,14 @@ Lint/UselessMethodDefinition:
|
|
2010
2110
|
Lint/UselessSetterCall:
|
2011
2111
|
Description: 'Checks for useless setter call to a local variable.'
|
2012
2112
|
Enabled: true
|
2113
|
+
SafeAutoCorrect: false
|
2013
2114
|
VersionAdded: '0.13'
|
2014
|
-
VersionChanged: '
|
2115
|
+
VersionChanged: '1.2'
|
2015
2116
|
Safe: false
|
2016
2117
|
|
2017
2118
|
Lint/UselessTimes:
|
2018
2119
|
Description: 'Checks for useless `Integer#times` calls.'
|
2019
|
-
Enabled:
|
2120
|
+
Enabled: true
|
2020
2121
|
VersionAdded: '0.91'
|
2021
2122
|
Safe: false
|
2022
2123
|
|
@@ -2037,21 +2138,23 @@ Metrics/AbcSize:
|
|
2037
2138
|
- https://en.wikipedia.org/wiki/ABC_Software_Metric
|
2038
2139
|
Enabled: true
|
2039
2140
|
VersionAdded: '0.27'
|
2040
|
-
VersionChanged: '
|
2141
|
+
VersionChanged: '1.5'
|
2041
2142
|
# The ABC size is a calculated magnitude, so this number can be an Integer or
|
2042
2143
|
# a Float.
|
2043
2144
|
IgnoredMethods: []
|
2145
|
+
CountRepeatedAttributes: true
|
2044
2146
|
Max: 17
|
2045
2147
|
|
2046
2148
|
Metrics/BlockLength:
|
2047
2149
|
Description: 'Avoid long blocks with many lines.'
|
2048
2150
|
Enabled: true
|
2049
2151
|
VersionAdded: '0.44'
|
2050
|
-
VersionChanged: '
|
2152
|
+
VersionChanged: '1.5'
|
2051
2153
|
CountComments: false # count full line comments?
|
2052
2154
|
Max: 25
|
2053
2155
|
CountAsOne: []
|
2054
|
-
ExcludedMethods:
|
2156
|
+
ExcludedMethods: [] # deprecated, retained for backwards compatibility
|
2157
|
+
IgnoredMethods:
|
2055
2158
|
# By default, exclude the `#refine` method, as it tends to have larger
|
2056
2159
|
# associated blocks.
|
2057
2160
|
- refine
|
@@ -2092,11 +2195,12 @@ Metrics/MethodLength:
|
|
2092
2195
|
StyleGuide: '#short-methods'
|
2093
2196
|
Enabled: true
|
2094
2197
|
VersionAdded: '0.25'
|
2095
|
-
VersionChanged: '
|
2198
|
+
VersionChanged: '1.5'
|
2096
2199
|
CountComments: false # count full line comments?
|
2097
2200
|
Max: 10
|
2098
2201
|
CountAsOne: []
|
2099
|
-
ExcludedMethods: []
|
2202
|
+
ExcludedMethods: [] # deprecated, retained for backwards compatibility
|
2203
|
+
IgnoredMethods: []
|
2100
2204
|
|
2101
2205
|
Metrics/ModuleLength:
|
2102
2206
|
Description: 'Avoid modules longer than 100 lines of code.'
|
@@ -2112,8 +2216,10 @@ Metrics/ParameterLists:
|
|
2112
2216
|
StyleGuide: '#too-many-params'
|
2113
2217
|
Enabled: true
|
2114
2218
|
VersionAdded: '0.25'
|
2219
|
+
VersionChanged: '1.5'
|
2115
2220
|
Max: 5
|
2116
2221
|
CountKeywordArgs: true
|
2222
|
+
MaxOptionalParameters: 3
|
2117
2223
|
|
2118
2224
|
Metrics/PerceivedComplexity:
|
2119
2225
|
Description: >-
|
@@ -2155,6 +2261,7 @@ Naming/BinaryOperatorParameterName:
|
|
2155
2261
|
StyleGuide: '#other-arg'
|
2156
2262
|
Enabled: true
|
2157
2263
|
VersionAdded: '0.50'
|
2264
|
+
VersionChanged: '1.2'
|
2158
2265
|
|
2159
2266
|
Naming/BlockParameterName:
|
2160
2267
|
Description: >-
|
@@ -2261,6 +2368,7 @@ Naming/HeredocDelimiterCase:
|
|
2261
2368
|
StyleGuide: '#heredoc-delimiters'
|
2262
2369
|
Enabled: true
|
2263
2370
|
VersionAdded: '0.50'
|
2371
|
+
VersionChanged: '1.2'
|
2264
2372
|
EnforcedStyle: uppercase
|
2265
2373
|
SupportedStyles:
|
2266
2374
|
- lowercase
|
@@ -2279,7 +2387,7 @@ Naming/MemoizedInstanceVariableName:
|
|
2279
2387
|
Memoized method name should match memo instance variable name.
|
2280
2388
|
Enabled: true
|
2281
2389
|
VersionAdded: '0.53'
|
2282
|
-
VersionChanged: '
|
2390
|
+
VersionChanged: '1.2'
|
2283
2391
|
EnforcedStyleForLeadingUnderscores: disallowed
|
2284
2392
|
SupportedStylesForLeadingUnderscores:
|
2285
2393
|
- disallowed
|
@@ -2377,14 +2485,25 @@ Naming/VariableName:
|
|
2377
2485
|
- camelCase
|
2378
2486
|
|
2379
2487
|
Naming/VariableNumber:
|
2380
|
-
Description: 'Use the configured style when numbering variables.'
|
2488
|
+
Description: 'Use the configured style when numbering symbols, methods and variables.'
|
2489
|
+
StyleGuide: '#snake-case-symbols-methods-vars-with-numbers'
|
2381
2490
|
Enabled: true
|
2382
2491
|
VersionAdded: '0.50'
|
2492
|
+
VersionChanged: '1.4'
|
2383
2493
|
EnforcedStyle: normalcase
|
2384
2494
|
SupportedStyles:
|
2385
2495
|
- snake_case
|
2386
2496
|
- normalcase
|
2387
2497
|
- non_integer
|
2498
|
+
CheckMethodNames: true
|
2499
|
+
CheckSymbols: true
|
2500
|
+
AllowedIdentifiers:
|
2501
|
+
- capture3 # Open3.capture3
|
2502
|
+
- iso8601 # Time#iso8601
|
2503
|
+
- rfc1123_date # CGI.rfc1123_date
|
2504
|
+
- rfc822 # Time#rfc822
|
2505
|
+
- rfc2822 # Time#rfc2822
|
2506
|
+
- rfc3339 # DateTime.rfc3339
|
2388
2507
|
|
2389
2508
|
#################### Security ##############################
|
2390
2509
|
|
@@ -2415,9 +2534,10 @@ Security/MarshalLoad:
|
|
2415
2534
|
VersionAdded: '0.47'
|
2416
2535
|
|
2417
2536
|
Security/Open:
|
2418
|
-
Description: 'The use of Kernel#open
|
2537
|
+
Description: 'The use of `Kernel#open` and `URI.open` represent a serious security risk.'
|
2419
2538
|
Enabled: true
|
2420
2539
|
VersionAdded: '0.53'
|
2540
|
+
VersionChanged: '1.0'
|
2421
2541
|
Safe: false
|
2422
2542
|
|
2423
2543
|
Security/YAMLLoad:
|
@@ -2444,7 +2564,7 @@ Style/AccessModifierDeclarations:
|
|
2444
2564
|
|
2445
2565
|
Style/AccessorGrouping:
|
2446
2566
|
Description: 'Checks for grouping of accessors in `class` and `module` bodies.'
|
2447
|
-
Enabled:
|
2567
|
+
Enabled: true
|
2448
2568
|
VersionAdded: '0.87'
|
2449
2569
|
EnforcedStyle: grouped
|
2450
2570
|
SupportedStyles:
|
@@ -2477,6 +2597,13 @@ Style/AndOr:
|
|
2477
2597
|
- always
|
2478
2598
|
- conditionals
|
2479
2599
|
|
2600
|
+
Style/ArgumentsForwarding:
|
2601
|
+
Description: 'Use arguments forwarding.'
|
2602
|
+
StyleGuide: '#arguments-forwarding'
|
2603
|
+
Enabled: pending
|
2604
|
+
AllowOnlyRestArgument: true
|
2605
|
+
VersionAdded: '1.1'
|
2606
|
+
|
2480
2607
|
Style/ArrayCoercion:
|
2481
2608
|
Description: >-
|
2482
2609
|
Use Array() instead of explicit Array check or [*var], when dealing
|
@@ -2533,7 +2660,7 @@ Style/BisectedAttrAccessor:
|
|
2533
2660
|
Description: >-
|
2534
2661
|
Checks for places where `attr_reader` and `attr_writer`
|
2535
2662
|
for the same method can be combined into single `attr_accessor`.
|
2536
|
-
Enabled:
|
2663
|
+
Enabled: true
|
2537
2664
|
VersionAdded: '0.87'
|
2538
2665
|
|
2539
2666
|
Style/BlockComments:
|
@@ -2672,7 +2799,7 @@ Style/CaseEquality:
|
|
2672
2799
|
Style/CaseLikeIf:
|
2673
2800
|
Description: 'This cop identifies places where `if-elsif` constructions can be replaced with `case-when`.'
|
2674
2801
|
StyleGuide: '#case-vs-if-else'
|
2675
|
-
Enabled:
|
2802
|
+
Enabled: true
|
2676
2803
|
Safe: false
|
2677
2804
|
VersionAdded: '0.88'
|
2678
2805
|
|
@@ -2725,7 +2852,7 @@ Style/ClassCheck:
|
|
2725
2852
|
Style/ClassEqualityComparison:
|
2726
2853
|
Description: 'Enforces the use of `Object#instance_of?` instead of class comparison for equality.'
|
2727
2854
|
StyleGuide: '#instance-of-vs-class-comparison'
|
2728
|
-
Enabled:
|
2855
|
+
Enabled: true
|
2729
2856
|
VersionAdded: '0.93'
|
2730
2857
|
IgnoredMethods:
|
2731
2858
|
- ==
|
@@ -2755,6 +2882,13 @@ Style/ClassVars:
|
|
2755
2882
|
Enabled: true
|
2756
2883
|
VersionAdded: '0.13'
|
2757
2884
|
|
2885
|
+
Style/CollectionCompact:
|
2886
|
+
Description: 'Use `{Array,Hash}#{compact,compact!}` instead of custom logic to reject nils.'
|
2887
|
+
Enabled: pending
|
2888
|
+
Safe: false
|
2889
|
+
VersionAdded: '1.2'
|
2890
|
+
VersionChanged: '1.3'
|
2891
|
+
|
2758
2892
|
# Align with the style guide.
|
2759
2893
|
Style/CollectionMethods:
|
2760
2894
|
Description: 'Preferred collection methods.'
|
@@ -2793,7 +2927,7 @@ Style/CombinableLoops:
|
|
2793
2927
|
Description: >-
|
2794
2928
|
Checks for places where multiple consecutive loops over the same data
|
2795
2929
|
can be combined into a single loop.
|
2796
|
-
Enabled:
|
2930
|
+
Enabled: true
|
2797
2931
|
Safe: false
|
2798
2932
|
VersionAdded: '0.90'
|
2799
2933
|
|
@@ -2818,17 +2952,18 @@ Style/CommandLiteral:
|
|
2818
2952
|
Style/CommentAnnotation:
|
2819
2953
|
Description: >-
|
2820
2954
|
Checks formatting of special comments
|
2821
|
-
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
|
2955
|
+
(TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE).
|
2822
2956
|
StyleGuide: '#annotate-keywords'
|
2823
2957
|
Enabled: true
|
2824
2958
|
VersionAdded: '0.10'
|
2825
|
-
VersionChanged: '
|
2959
|
+
VersionChanged: '1.3'
|
2826
2960
|
Keywords:
|
2827
2961
|
- TODO
|
2828
2962
|
- FIXME
|
2829
2963
|
- OPTIMIZE
|
2830
2964
|
- HACK
|
2831
2965
|
- REVIEW
|
2966
|
+
- NOTE
|
2832
2967
|
|
2833
2968
|
Style/CommentedKeyword:
|
2834
2969
|
Description: 'Do not place comments on the same line as certain keywords.'
|
@@ -2917,6 +3052,15 @@ Style/DisableCopsWithinSourceCodeDirective:
|
|
2917
3052
|
Enabled: false
|
2918
3053
|
VersionAdded: '0.82'
|
2919
3054
|
|
3055
|
+
Style/DocumentDynamicEvalDefinition:
|
3056
|
+
Description: >-
|
3057
|
+
When using `class_eval` (or other `eval`) with string interpolation,
|
3058
|
+
add a comment block showing its appearance if interpolated.
|
3059
|
+
StyleGuide: '#eval-comment-docs'
|
3060
|
+
Enabled: pending
|
3061
|
+
VersionAdded: '1.1'
|
3062
|
+
VersionChanged: '1.3'
|
3063
|
+
|
2920
3064
|
Style/Documentation:
|
2921
3065
|
Description: 'Document classes and non-namespace modules.'
|
2922
3066
|
Enabled: true
|
@@ -2944,7 +3088,7 @@ Style/DoubleNegation:
|
|
2944
3088
|
StyleGuide: '#no-bang-bang'
|
2945
3089
|
Enabled: true
|
2946
3090
|
VersionAdded: '0.19'
|
2947
|
-
VersionChanged: '
|
3091
|
+
VersionChanged: '1.2'
|
2948
3092
|
EnforcedStyle: allowed_in_returns
|
2949
3093
|
SafeAutoCorrect: false
|
2950
3094
|
SupportedStyles:
|
@@ -3046,7 +3190,7 @@ Style/ExplicitBlockArgument:
|
|
3046
3190
|
Consider using explicit block argument to avoid writing block literal
|
3047
3191
|
that just passes its arguments to another block.
|
3048
3192
|
StyleGuide: '#block-argument'
|
3049
|
-
Enabled:
|
3193
|
+
Enabled: true
|
3050
3194
|
# May change the yielding arity.
|
3051
3195
|
Safe: false
|
3052
3196
|
VersionAdded: '0.89'
|
@@ -3054,7 +3198,7 @@ Style/ExplicitBlockArgument:
|
|
3054
3198
|
Style/ExponentialNotation:
|
3055
3199
|
Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
|
3056
3200
|
StyleGuide: '#exponential-notation'
|
3057
|
-
Enabled:
|
3201
|
+
Enabled: true
|
3058
3202
|
VersionAdded: '0.82'
|
3059
3203
|
EnforcedStyle: scientific
|
3060
3204
|
SupportedStyles:
|
@@ -3109,8 +3253,12 @@ Style/FormatStringToken:
|
|
3109
3253
|
# Prefer simple looking "template" style tokens like `%{name}`, `%{age}`
|
3110
3254
|
- template
|
3111
3255
|
- unannotated
|
3256
|
+
# `MaxUnannotatedPlaceholdersAllowed` defines the number of `unannotated`
|
3257
|
+
# style token in a format string to be allowed when enforced style is not
|
3258
|
+
# `unannotated`.
|
3259
|
+
MaxUnannotatedPlaceholdersAllowed: 1
|
3112
3260
|
VersionAdded: '0.49'
|
3113
|
-
VersionChanged: '0
|
3261
|
+
VersionChanged: '1.0'
|
3114
3262
|
|
3115
3263
|
Style/FrozenStringLiteralComment:
|
3116
3264
|
Description: >-
|
@@ -3137,7 +3285,7 @@ Style/FrozenStringLiteralComment:
|
|
3137
3285
|
Style/GlobalStdStream:
|
3138
3286
|
Description: 'Enforces the use of `$stdout/$stderr/$stdin` instead of `STDOUT/STDERR/STDIN`.'
|
3139
3287
|
StyleGuide: '#global-stdout'
|
3140
|
-
Enabled:
|
3288
|
+
Enabled: true
|
3141
3289
|
VersionAdded: '0.89'
|
3142
3290
|
SafeAutoCorrect: false
|
3143
3291
|
|
@@ -3165,7 +3313,7 @@ Style/HashAsLastArrayItem:
|
|
3165
3313
|
Checks for presence or absence of braces around hash literal as a last
|
3166
3314
|
array item depending on configuration.
|
3167
3315
|
StyleGuide: '#hash-literal-as-last-array-item'
|
3168
|
-
Enabled:
|
3316
|
+
Enabled: true
|
3169
3317
|
VersionAdded: '0.88'
|
3170
3318
|
EnforcedStyle: braces
|
3171
3319
|
SupportedStyles:
|
@@ -3175,7 +3323,7 @@ Style/HashAsLastArrayItem:
|
|
3175
3323
|
Style/HashEachMethods:
|
3176
3324
|
Description: 'Use Hash#each_key and Hash#each_value.'
|
3177
3325
|
StyleGuide: '#hash-each'
|
3178
|
-
Enabled:
|
3326
|
+
Enabled: true
|
3179
3327
|
VersionAdded: '0.80'
|
3180
3328
|
Safe: false
|
3181
3329
|
|
@@ -3183,7 +3331,7 @@ Style/HashLikeCase:
|
|
3183
3331
|
Description: >-
|
3184
3332
|
Checks for places where `case-when` represents a simple 1:1
|
3185
3333
|
mapping and can be replaced with a hash lookup.
|
3186
|
-
Enabled:
|
3334
|
+
Enabled: true
|
3187
3335
|
VersionAdded: '0.88'
|
3188
3336
|
# `MinBranchesCount` defines the number of branches `case` needs to have
|
3189
3337
|
# to trigger this cop
|
@@ -3214,14 +3362,14 @@ Style/HashSyntax:
|
|
3214
3362
|
|
3215
3363
|
Style/HashTransformKeys:
|
3216
3364
|
Description: 'Prefer `transform_keys` over `each_with_object`, `map`, or `to_h`.'
|
3217
|
-
Enabled:
|
3365
|
+
Enabled: true
|
3218
3366
|
VersionAdded: '0.80'
|
3219
3367
|
VersionChanged: '0.90'
|
3220
3368
|
Safe: false
|
3221
3369
|
|
3222
3370
|
Style/HashTransformValues:
|
3223
3371
|
Description: 'Prefer `transform_values` over `each_with_object`, `map`, or `to_h`.'
|
3224
|
-
Enabled:
|
3372
|
+
Enabled: true
|
3225
3373
|
VersionAdded: '0.80'
|
3226
3374
|
VersionChanged: '0.90'
|
3227
3375
|
Safe: false
|
@@ -3239,6 +3387,7 @@ Style/IfInsideElse:
|
|
3239
3387
|
Enabled: true
|
3240
3388
|
AllowIfModifier: false
|
3241
3389
|
VersionAdded: '0.36'
|
3390
|
+
VersionChanged: '1.3'
|
3242
3391
|
|
3243
3392
|
Style/IfUnlessModifier:
|
3244
3393
|
Description: >-
|
@@ -3271,12 +3420,14 @@ Style/ImplicitRuntimeError:
|
|
3271
3420
|
VersionAdded: '0.41'
|
3272
3421
|
|
3273
3422
|
Style/InfiniteLoop:
|
3274
|
-
Description:
|
3423
|
+
Description: >-
|
3424
|
+
Use Kernel#loop for infinite loops.
|
3425
|
+
This cop is unsafe in the body may raise a `StopIteration` exception.
|
3426
|
+
Safe: false
|
3275
3427
|
StyleGuide: '#infinite-loop'
|
3276
3428
|
Enabled: true
|
3277
3429
|
VersionAdded: '0.26'
|
3278
3430
|
VersionChanged: '0.61'
|
3279
|
-
SafeAutoCorrect: true
|
3280
3431
|
|
3281
3432
|
Style/InlineComment:
|
3282
3433
|
Description: 'Avoid trailing inline comments.'
|
@@ -3328,7 +3479,7 @@ Style/IpAddresses:
|
|
3328
3479
|
Style/KeywordParametersOrder:
|
3329
3480
|
Description: 'Enforces that optional keyword parameters are placed at the end of the parameters list.'
|
3330
3481
|
StyleGuide: '#keyword-parameters-order'
|
3331
|
-
Enabled:
|
3482
|
+
Enabled: true
|
3332
3483
|
VersionAdded: '0.90'
|
3333
3484
|
|
3334
3485
|
Style/Lambda:
|
@@ -3530,6 +3681,7 @@ Style/MultipleComparison:
|
|
3530
3681
|
use Array#include? instead.
|
3531
3682
|
Enabled: true
|
3532
3683
|
VersionAdded: '0.49'
|
3684
|
+
VersionChanged: '1.1'
|
3533
3685
|
|
3534
3686
|
Style/MutableConstant:
|
3535
3687
|
Description: 'Do not assign mutable objects to constants.'
|
@@ -3564,6 +3716,13 @@ Style/NegatedIf:
|
|
3564
3716
|
- prefix
|
3565
3717
|
- postfix
|
3566
3718
|
|
3719
|
+
Style/NegatedIfElseCondition:
|
3720
|
+
Description: >-
|
3721
|
+
This cop checks for uses of `if-else` and ternary operators with a negated condition
|
3722
|
+
which can be simplified by inverting condition and swapping branches.
|
3723
|
+
Enabled: pending
|
3724
|
+
VersionAdded: '1.2'
|
3725
|
+
|
3567
3726
|
Style/NegatedUnless:
|
3568
3727
|
Description: 'Favor if over unless for negative conditions.'
|
3569
3728
|
StyleGuide: '#if-for-negatives'
|
@@ -3651,6 +3810,11 @@ Style/NilComparison:
|
|
3651
3810
|
- predicate
|
3652
3811
|
- comparison
|
3653
3812
|
|
3813
|
+
Style/NilLambda:
|
3814
|
+
Description: 'Prefer `-> {}` to `-> { nil }`.'
|
3815
|
+
Enabled: pending
|
3816
|
+
VersionAdded: '1.3'
|
3817
|
+
|
3654
3818
|
Style/NonNilCheck:
|
3655
3819
|
Description: 'Checks for redundant nil checks.'
|
3656
3820
|
StyleGuide: '#no-non-nil-checks'
|
@@ -3753,7 +3917,7 @@ Style/OptionalArguments:
|
|
3753
3917
|
Style/OptionalBooleanParameter:
|
3754
3918
|
Description: 'Use keyword arguments when defining method with boolean argument.'
|
3755
3919
|
StyleGuide: '#boolean-keyword-arguments'
|
3756
|
-
Enabled:
|
3920
|
+
Enabled: true
|
3757
3921
|
Safe: false
|
3758
3922
|
VersionAdded: '0.89'
|
3759
3923
|
AllowedMethods:
|
@@ -3800,7 +3964,7 @@ Style/PercentLiteralDelimiters:
|
|
3800
3964
|
'%r': '{}'
|
3801
3965
|
'%w': '[]'
|
3802
3966
|
'%W': '[]'
|
3803
|
-
VersionChanged: '0.48
|
3967
|
+
VersionChanged: '0.48'
|
3804
3968
|
|
3805
3969
|
Style/PercentQLiterals:
|
3806
3970
|
Description: 'Checks if uses of %Q/%q match the configured preference.'
|
@@ -3841,11 +4005,12 @@ Style/RaiseArgs:
|
|
3841
4005
|
StyleGuide: '#exception-class-messages'
|
3842
4006
|
Enabled: true
|
3843
4007
|
VersionAdded: '0.14'
|
3844
|
-
VersionChanged: '
|
4008
|
+
VersionChanged: '1.2'
|
3845
4009
|
EnforcedStyle: exploded
|
3846
4010
|
SupportedStyles:
|
3847
4011
|
- compact # raise Exception.new(msg)
|
3848
4012
|
- exploded # raise Exception, msg
|
4013
|
+
AllowedCompactTypes: []
|
3849
4014
|
|
3850
4015
|
Style/RandomWithOffset:
|
3851
4016
|
Description: >-
|
@@ -3855,9 +4020,20 @@ Style/RandomWithOffset:
|
|
3855
4020
|
Enabled: true
|
3856
4021
|
VersionAdded: '0.52'
|
3857
4022
|
|
4023
|
+
Style/RedundantArgument:
|
4024
|
+
Description: 'Check for a redundant argument passed to certain methods.'
|
4025
|
+
Enabled: pending
|
4026
|
+
Safe: false
|
4027
|
+
VersionAdded: '1.4'
|
4028
|
+
Methods:
|
4029
|
+
# Array#join
|
4030
|
+
join: ''
|
4031
|
+
# String#split
|
4032
|
+
split: ' '
|
4033
|
+
|
3858
4034
|
Style/RedundantAssignment:
|
3859
4035
|
Description: 'Checks for redundant assignment before returning.'
|
3860
|
-
Enabled:
|
4036
|
+
Enabled: true
|
3861
4037
|
VersionAdded: '0.87'
|
3862
4038
|
|
3863
4039
|
Style/RedundantBegin:
|
@@ -3894,7 +4070,7 @@ Style/RedundantFetchBlock:
|
|
3894
4070
|
Use `fetch(key, value)` instead of `fetch(key) { value }`
|
3895
4071
|
when value has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil` or is a constant.
|
3896
4072
|
Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code'
|
3897
|
-
Enabled:
|
4073
|
+
Enabled: true
|
3898
4074
|
Safe: false
|
3899
4075
|
# If enabled, this cop will autocorrect usages of
|
3900
4076
|
# `fetch` being called with block returning a constant.
|
@@ -3907,7 +4083,7 @@ Style/RedundantFileExtensionInRequire:
|
|
3907
4083
|
Checks for the presence of superfluous `.rb` extension in
|
3908
4084
|
the filename provided to `require` and `require_relative`.
|
3909
4085
|
StyleGuide: '#no-explicit-rb-to-require'
|
3910
|
-
Enabled:
|
4086
|
+
Enabled: true
|
3911
4087
|
VersionAdded: '0.88'
|
3912
4088
|
|
3913
4089
|
Style/RedundantFreeze:
|
@@ -3934,12 +4110,12 @@ Style/RedundantPercentQ:
|
|
3934
4110
|
|
3935
4111
|
Style/RedundantRegexpCharacterClass:
|
3936
4112
|
Description: 'Checks for unnecessary single-element Regexp character classes.'
|
3937
|
-
Enabled:
|
4113
|
+
Enabled: true
|
3938
4114
|
VersionAdded: '0.85'
|
3939
4115
|
|
3940
4116
|
Style/RedundantRegexpEscape:
|
3941
4117
|
Description: 'Checks for redundant escapes in Regexps.'
|
3942
|
-
Enabled:
|
4118
|
+
Enabled: true
|
3943
4119
|
VersionAdded: '0.85'
|
3944
4120
|
|
3945
4121
|
Style/RedundantReturn:
|
@@ -3960,7 +4136,7 @@ Style/RedundantSelf:
|
|
3960
4136
|
|
3961
4137
|
Style/RedundantSelfAssignment:
|
3962
4138
|
Description: 'Checks for places where redundant assignments are made for in place modification methods.'
|
3963
|
-
Enabled:
|
4139
|
+
Enabled: true
|
3964
4140
|
Safe: false
|
3965
4141
|
VersionAdded: '0.90'
|
3966
4142
|
|
@@ -4088,7 +4264,7 @@ Style/SignalException:
|
|
4088
4264
|
|
4089
4265
|
Style/SingleArgumentDig:
|
4090
4266
|
Description: 'Avoid using single argument dig method.'
|
4091
|
-
Enabled:
|
4267
|
+
Enabled: true
|
4092
4268
|
VersionAdded: '0.89'
|
4093
4269
|
Safe: false
|
4094
4270
|
|
@@ -4115,7 +4291,7 @@ Style/SingleLineMethods:
|
|
4115
4291
|
|
4116
4292
|
Style/SlicingWithRange:
|
4117
4293
|
Description: 'Checks array slicing is done with endless ranges when suitable.'
|
4118
|
-
Enabled:
|
4294
|
+
Enabled: true
|
4119
4295
|
VersionAdded: '0.83'
|
4120
4296
|
Safe: false
|
4121
4297
|
|
@@ -4123,8 +4299,9 @@ Style/SoleNestedConditional:
|
|
4123
4299
|
Description: >-
|
4124
4300
|
Finds sole nested conditional nodes
|
4125
4301
|
which can be merged into outer conditional node.
|
4126
|
-
Enabled:
|
4302
|
+
Enabled: true
|
4127
4303
|
VersionAdded: '0.89'
|
4304
|
+
VersionChanged: '1.5'
|
4128
4305
|
AllowModifier: false
|
4129
4306
|
|
4130
4307
|
Style/SpecialGlobalVars:
|
@@ -4149,6 +4326,13 @@ Style/StabbyLambdaParentheses:
|
|
4149
4326
|
- require_parentheses
|
4150
4327
|
- require_no_parentheses
|
4151
4328
|
|
4329
|
+
Style/StaticClass:
|
4330
|
+
Description: 'Prefer modules to classes with only class methods.'
|
4331
|
+
StyleGuide: '#modules-vs-classes'
|
4332
|
+
Enabled: false
|
4333
|
+
Safe: false
|
4334
|
+
VersionAdded: '1.3'
|
4335
|
+
|
4152
4336
|
Style/StderrPuts:
|
4153
4337
|
Description: 'Use `warn` instead of `$stderr.puts`.'
|
4154
4338
|
StyleGuide: '#warn'
|
@@ -4158,7 +4342,7 @@ Style/StderrPuts:
|
|
4158
4342
|
Style/StringConcatenation:
|
4159
4343
|
Description: 'Checks for places where string concatenation can be replaced with string interpolation.'
|
4160
4344
|
StyleGuide: '#string-interpolation'
|
4161
|
-
Enabled:
|
4345
|
+
Enabled: true
|
4162
4346
|
Safe: false
|
4163
4347
|
VersionAdded: '0.89'
|
4164
4348
|
|
@@ -4199,7 +4383,7 @@ Style/StringMethods:
|
|
4199
4383
|
Description: 'Checks if configured preferred methods are used over non-preferred.'
|
4200
4384
|
Enabled: false
|
4201
4385
|
VersionAdded: '0.34'
|
4202
|
-
VersionChanged: '0.34
|
4386
|
+
VersionChanged: '0.34'
|
4203
4387
|
# Mapping from undesired method to desired_method
|
4204
4388
|
# e.g. to use `to_sym` over `intern`:
|
4205
4389
|
#
|
@@ -4221,6 +4405,13 @@ Style/StructInheritance:
|
|
4221
4405
|
VersionAdded: '0.29'
|
4222
4406
|
VersionChanged: '0.86'
|
4223
4407
|
|
4408
|
+
Style/SwapValues:
|
4409
|
+
Description: 'This cop enforces the use of shorthand-style swapping of 2 variables.'
|
4410
|
+
StyleGuide: '#values-swapping'
|
4411
|
+
Enabled: pending
|
4412
|
+
VersionAdded: '1.1'
|
4413
|
+
SafeAutoCorrect: false
|
4414
|
+
|
4224
4415
|
Style/SymbolArray:
|
4225
4416
|
Description: 'Use %i or %I for arrays of symbols.'
|
4226
4417
|
StyleGuide: '#percent-i'
|
@@ -4243,7 +4434,7 @@ Style/SymbolProc:
|
|
4243
4434
|
Enabled: true
|
4244
4435
|
Safe: false
|
4245
4436
|
VersionAdded: '0.26'
|
4246
|
-
VersionChanged: '
|
4437
|
+
VersionChanged: '1.5'
|
4247
4438
|
# A list of method names to be ignored by the check.
|
4248
4439
|
# The names should be fairly unique, otherwise you'll end up ignoring lots of code.
|
4249
4440
|
IgnoredMethods:
|