cookstyle 6.13.3 → 6.16.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/config/cookstyle.yml +81 -46
- data/config/disable_all.yml +48 -4
- data/config/upstream.yml +175 -27
- data/cookstyle.gemspec +1 -0
- data/lib/cookstyle.rb +7 -7
- data/lib/cookstyle/version.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/block_guard_clause_string_only.rb +7 -9
- data/lib/rubocop/cop/chef/correctness/chef_application_fatal.rb +5 -9
- data/lib/rubocop/cop/chef/correctness/conditional_ruby_shellout.rb +5 -9
- data/lib/rubocop/cop/chef/correctness/dnf_package_allow_downgrades.rb +5 -8
- data/lib/rubocop/cop/chef/correctness/incorrect_library_injection.rb +11 -9
- data/lib/rubocop/cop/chef/correctness/invalid_default_action.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/invalid_notification_timing.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/invalid_platform_family_helper.rb +21 -4
- data/lib/rubocop/cop/chef/correctness/invalid_platform_family_values_in_case.rb +15 -23
- data/lib/rubocop/cop/chef/correctness/invalid_platform_helper.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/invalid_platform_metadata.rb +12 -14
- data/lib/rubocop/cop/chef/correctness/invalid_platform_values_in_case.rb +13 -22
- data/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_family_helper.rb +4 -3
- data/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_helper.rb +4 -3
- data/lib/rubocop/cop/chef/correctness/invalid_version_metadata.rb +3 -4
- data/lib/rubocop/cop/chef/correctness/lazy_eval_node_attribute_defaults.rb +5 -8
- data/lib/rubocop/cop/chef/correctness/macos_userdefaults_invalid_type.rb +67 -0
- data/lib/rubocop/cop/chef/correctness/malformed_value_for_platform.rb +4 -5
- data/lib/rubocop/cop/chef/correctness/metadata_missing_name.rb +5 -12
- data/lib/rubocop/cop/chef/correctness/node_normal.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/node_normal_unless.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/node_save.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/notifies_action_not_symbol.rb +11 -11
- data/lib/rubocop/cop/chef/correctness/openssl_password_helpers.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/powershell_delete_file.rb +4 -4
- data/lib/rubocop/cop/chef/correctness/resource_sets_internal_properties.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/resource_sets_name_property.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/resource_with_none_action.rb +6 -2
- data/lib/rubocop/cop/chef/correctness/scoped_file_exist.rb +6 -8
- data/lib/rubocop/cop/chef/correctness/service_resource.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/tmp_path.rb +3 -4
- data/lib/rubocop/cop/chef/{correctness → deprecation}/cb_depends_on_self.rb +6 -11
- data/lib/rubocop/cop/chef/deprecation/chef_handler_recipe.rb +5 -8
- data/lib/rubocop/cop/chef/deprecation/chef_handler_supports.rb +7 -10
- data/lib/rubocop/cop/chef/deprecation/chef_rest.rb +3 -3
- data/lib/rubocop/cop/chef/deprecation/chef_rewind.rb +15 -28
- data/lib/rubocop/cop/chef/deprecation/chef_windows_platform_helper.rb +5 -8
- data/lib/rubocop/cop/chef/deprecation/chefdk_generators.rb +3 -6
- data/lib/rubocop/cop/chef/deprecation/cheffile.rb +5 -7
- data/lib/rubocop/cop/chef/deprecation/chefspec_coverage_report.rb +5 -8
- data/lib/rubocop/cop/chef/deprecation/chefspec_legacy_runner.rb +5 -8
- data/lib/rubocop/cop/chef/deprecation/chocolatey_package_uninstall_action.rb +6 -8
- data/lib/rubocop/cop/chef/deprecation/depends_compat_resource.rb +5 -8
- data/lib/rubocop/cop/chef/deprecation/depends_partial_search.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/depends_poise.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/deprecated_chefspec_platform.rb +11 -14
- data/lib/rubocop/cop/chef/deprecation/deprecated_mixins.rb +11 -10
- data/lib/rubocop/cop/chef/deprecation/deprecated_platform_methods.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/deprecated_shellout_methods.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/deprecated_windows_version_check.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/deprecated_yum_repository_properties.rb +8 -8
- data/lib/rubocop/cop/chef/deprecation/easy_install.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/eol_audit_mode.rb +4 -4
- data/lib/rubocop/cop/chef/deprecation/epic_fail.rb +5 -6
- data/lib/rubocop/cop/chef/deprecation/erl_call.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/hwrp_without_provides.rb +11 -12
- data/lib/rubocop/cop/chef/deprecation/inherits_compat_resource.rb +6 -8
- data/lib/rubocop/cop/chef/deprecation/launchd_deprecated_hash_property.rb +6 -9
- data/lib/rubocop/cop/chef/deprecation/legacy_notify_syntax.rb +5 -9
- data/lib/rubocop/cop/chef/deprecation/legacy_yum_cookbook_recipes.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/locale_lc_all_property.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/macos_userdefaults_global_property.rb +61 -0
- data/lib/rubocop/cop/chef/deprecation/name_property_and_default.rb +4 -9
- data/lib/rubocop/cop/chef/deprecation/node_methods_not_attributes.rb +6 -8
- data/lib/rubocop/cop/chef/deprecation/node_set.rb +6 -8
- data/lib/rubocop/cop/chef/deprecation/node_set_unless.rb +6 -8
- data/lib/rubocop/cop/chef/deprecation/node_set_without_level.rb +6 -4
- data/lib/rubocop/cop/chef/deprecation/partial_search_class_usage.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/partial_search_helper_usage.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/poise_archive.rb +7 -5
- data/lib/rubocop/cop/chef/deprecation/powershell_cookbook_helpers.rb +5 -9
- data/lib/rubocop/cop/chef/deprecation/require_recipe.rb +7 -7
- data/lib/rubocop/cop/chef/deprecation/resource_overrides_provides_method.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/resource_uses_dsl_name_method.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/resource_uses_only_resource_name.rb +8 -12
- data/lib/rubocop/cop/chef/deprecation/resource_uses_provider_base_method.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/resource_uses_updated_method.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings.rb +6 -10
- data/lib/rubocop/cop/chef/deprecation/ruby_block_create_action.rb +6 -8
- data/lib/rubocop/cop/chef/deprecation/run_command_helper.rb +4 -4
- data/lib/rubocop/cop/chef/deprecation/search_uses_positional_parameters.rb +6 -8
- data/lib/rubocop/cop/chef/deprecation/use_inline_resources.rb +5 -7
- data/lib/rubocop/cop/chef/deprecation/user_supports_property.rb +11 -14
- data/lib/rubocop/cop/chef/deprecation/verify_property_file_expansion.rb +6 -8
- data/lib/rubocop/cop/chef/deprecation/windows_feature_servermanagercmd.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/windows_task_change_action.rb +11 -16
- data/lib/rubocop/cop/chef/deprecation/windows_version_helpers.rb +4 -9
- data/lib/rubocop/cop/chef/deprecation/xml_ruby_recipe.rb +6 -8
- data/lib/rubocop/cop/chef/deprecation/yum_dnf_compat_recipe.rb +5 -8
- data/lib/rubocop/cop/chef/effortless/berksfile.rb +3 -5
- data/lib/rubocop/cop/chef/effortless/data_bags.rb +2 -2
- data/lib/rubocop/cop/chef/effortless/node_environment.rb +6 -3
- data/lib/rubocop/cop/chef/effortless/node_policygroup.rb +6 -3
- data/lib/rubocop/cop/chef/effortless/node_roles.rb +9 -6
- data/lib/rubocop/cop/chef/effortless/search_for_environments_or_roles.rb +4 -3
- data/lib/rubocop/cop/chef/effortless/search_used.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/allowed_actions_initializer.rb +17 -17
- data/lib/rubocop/cop/chef/modernize/apt_default_recipe.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/berksfile_source.rb +9 -9
- data/lib/rubocop/cop/chef/modernize/build_essential.rb +6 -8
- data/lib/rubocop/cop/chef/modernize/chef_14_resources.rb +5 -8
- data/lib/rubocop/cop/chef/modernize/chef_gem_nokogiri.rb +11 -10
- data/lib/rubocop/cop/chef/modernize/compile_time_resources.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/conditional_using_test.rb +5 -8
- data/lib/rubocop/cop/chef/modernize/cron_d_file_or_template.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/cron_manage_resource.rb +4 -6
- data/lib/rubocop/cop/chef/modernize/databag_helpers.rb +7 -8
- data/lib/rubocop/cop/chef/modernize/default_action_initializer.rb +12 -14
- data/lib/rubocop/cop/chef/modernize/defines_chefspec_matchers.rb +5 -8
- data/lib/rubocop/cop/chef/modernize/definitions.rb +3 -3
- data/lib/rubocop/cop/chef/modernize/depends_zypper_cookbook.rb +5 -8
- data/lib/rubocop/cop/chef/modernize/dsl_include_in_resource.rb +5 -8
- data/lib/rubocop/cop/chef/modernize/empty_resource_initialize.rb +5 -8
- data/lib/rubocop/cop/chef/modernize/execute_apt_update.rb +6 -4
- data/lib/rubocop/cop/chef/modernize/execute_sc_exe.rb +6 -9
- data/lib/rubocop/cop/chef/modernize/execute_sleep.rb +6 -11
- data/lib/rubocop/cop/chef/modernize/execute_sysctl.rb +5 -9
- data/lib/rubocop/cop/chef/modernize/execute_tzutil.rb +7 -4
- data/lib/rubocop/cop/chef/modernize/foodcritic_comments.rb +7 -12
- data/lib/rubocop/cop/chef/modernize/if_provides_default_action.rb +4 -6
- data/lib/rubocop/cop/chef/modernize/includes_mixin_shellout.rb +5 -8
- data/lib/rubocop/cop/chef/modernize/libarchive_file.rb +12 -9
- data/lib/rubocop/cop/chef/modernize/macos_user_defaults.rb +4 -6
- data/lib/rubocop/cop/chef/modernize/minitest_handler_usage.rb +5 -8
- data/lib/rubocop/cop/chef/modernize/node_roles_include.rb +5 -9
- data/lib/rubocop/cop/chef/modernize/ohai_default_recipe.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/openssl_rsa_key_resource.rb +4 -6
- data/lib/rubocop/cop/chef/modernize/openssl_x509_resource.rb +4 -6
- data/lib/rubocop/cop/chef/modernize/osx_config_profile_resource.rb +5 -6
- data/lib/rubocop/cop/chef/modernize/powershell_expand_archive.rb +3 -4
- data/lib/rubocop/cop/chef/modernize/powershell_guard_interpreter.rb +5 -9
- data/lib/rubocop/cop/chef/modernize/powershell_install_package.rb +3 -4
- data/lib/rubocop/cop/chef/modernize/powershell_install_windowsfeature.rb +3 -4
- data/lib/rubocop/cop/chef/modernize/property_with_name_attribute.rb +5 -9
- data/lib/rubocop/cop/chef/modernize/provides_initializer.rb +14 -16
- data/lib/rubocop/cop/chef/modernize/resource_name_initializer.rb +11 -15
- data/lib/rubocop/cop/chef/modernize/resource_set_or_return.rb +3 -4
- data/lib/rubocop/cop/chef/modernize/resource_with_attributes.rb +7 -8
- data/lib/rubocop/cop/chef/modernize/respond_to_compile_time.rb +4 -9
- data/lib/rubocop/cop/chef/modernize/respond_to_metadata.rb +20 -16
- data/lib/rubocop/cop/chef/modernize/respond_to_provides.rb +6 -8
- data/lib/rubocop/cop/chef/modernize/respond_to_resource_name.rb +6 -8
- data/lib/rubocop/cop/chef/modernize/sc_windows_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/seven_zip_archive.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/shell_out_helper.rb +3 -8
- data/lib/rubocop/cop/chef/modernize/shellouts_to_chocolatey.rb +5 -7
- data/lib/rubocop/cop/chef/modernize/simplify_apt_ppa_setup.rb +6 -10
- data/lib/rubocop/cop/chef/modernize/systctl_param_resource.rb +4 -6
- data/lib/rubocop/cop/chef/modernize/unnecessary_mixlib_shellout_require.rb +5 -8
- data/lib/rubocop/cop/chef/modernize/use_multipackage_installs.rb +14 -13
- data/lib/rubocop/cop/chef/modernize/use_require_relative.rb +6 -9
- data/lib/rubocop/cop/chef/modernize/whyrun_supported_true.rb +5 -8
- data/lib/rubocop/cop/chef/modernize/windows_default_recipe.rb +5 -8
- data/lib/rubocop/cop/chef/modernize/windows_registry_uac.rb +6 -7
- data/lib/rubocop/cop/chef/modernize/windows_zipfile.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/zipfile_resource.rb +3 -3
- data/lib/rubocop/cop/chef/modernize/zypper_repo.rb +4 -6
- data/lib/rubocop/cop/chef/redundant/apt_repository_distribution_default.rb +5 -8
- data/lib/rubocop/cop/chef/redundant/apt_repository_notifies_apt_update.rb +6 -8
- data/lib/rubocop/cop/chef/redundant/attribute_metadata.rb +4 -6
- data/lib/rubocop/cop/chef/redundant/conflicts_metadata.rb +4 -6
- data/lib/rubocop/cop/chef/redundant/custom_resource_with_allowed_actions.rb +6 -9
- data/lib/rubocop/cop/chef/redundant/grouping_metadata.rb +4 -5
- data/lib/rubocop/cop/chef/redundant/long_description_metadata.rb +4 -5
- data/lib/rubocop/cop/chef/redundant/multiple_platform_checks.rb +7 -9
- data/lib/rubocop/cop/chef/redundant/name_property_and_required.rb +2 -2
- data/lib/rubocop/cop/chef/redundant/ohai_attribute_to_string.rb +6 -10
- data/lib/rubocop/cop/chef/redundant/property_splat_regex.rb +8 -9
- data/lib/rubocop/cop/chef/redundant/property_with_default_and_required.rb +4 -9
- data/lib/rubocop/cop/chef/redundant/provides_metadata.rb +4 -5
- data/lib/rubocop/cop/chef/redundant/recipe_metadata.rb +4 -5
- data/lib/rubocop/cop/chef/redundant/replaces_metadata.rb +4 -5
- data/lib/rubocop/cop/chef/redundant/resource_with_nothing_action.rb +5 -8
- data/lib/rubocop/cop/chef/redundant/sensitive_property_in_resource.rb +5 -7
- data/lib/rubocop/cop/chef/redundant/string_property_with_nil_default.rb +6 -9
- data/lib/rubocop/cop/chef/redundant/suggests_metadata.rb +4 -5
- data/lib/rubocop/cop/chef/redundant/unnecessary_name_property.rb +9 -9
- data/lib/rubocop/cop/chef/redundant/use_create_if_missing.rb +7 -9
- data/lib/rubocop/cop/chef/sharing/default_maintainer_metadata.rb +2 -2
- data/lib/rubocop/cop/chef/sharing/empty_metadata_field.rb +4 -3
- data/lib/rubocop/cop/chef/sharing/include_property_descriptions.rb +5 -5
- data/lib/rubocop/cop/chef/sharing/include_resource_descriptions.rb +7 -7
- data/lib/rubocop/cop/chef/sharing/include_resource_examples.rb +6 -6
- data/lib/rubocop/cop/chef/sharing/insecure_cookbook_url.rb +6 -8
- data/lib/rubocop/cop/chef/sharing/invalid_license_string.rb +7 -12
- data/lib/rubocop/cop/chef/style/chef_whaaat.rb +3 -4
- data/lib/rubocop/cop/chef/style/comment_sentence_spacing.rb +5 -7
- data/lib/rubocop/cop/chef/style/comments_copyright_format.rb +5 -9
- data/lib/rubocop/cop/chef/style/comments_default_copyright.rb +5 -7
- data/lib/rubocop/cop/chef/style/comments_format.rb +13 -16
- data/lib/rubocop/cop/chef/style/file_mode.rb +38 -19
- data/lib/rubocop/cop/chef/style/immediate_notification_timing.rb +6 -8
- data/lib/rubocop/cop/chef/style/negating_only_if.rb +5 -9
- data/lib/rubocop/cop/chef/style/overly_complex_supports_depends_metadata.rb +5 -9
- data/lib/rubocop/cop/chef/style/simplify_platform_major_version_check.rb +6 -8
- data/lib/rubocop/cop/chef/style/true_false_resource_properties.rb +4 -9
- data/lib/rubocop/cop/chef/style/unnecessary_os_check.rb +17 -28
- data/lib/rubocop/cop/chef/style/unnecessary_platform_case_statement.rb +6 -10
- data/lib/rubocop/cop/chef/style/use_platform_helpers.rb +11 -19
- data/lib/rubocop/monkey_patches/{cop.rb → base.rb} +1 -1
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c12050a348d700990dba93b33e7e15d0151ff5f2fef01aed90bb4f8014a6c04b
|
4
|
+
data.tar.gz: 62577299c8994813248be5f8c73e27680fd9907d7c2088656e0cb03f035f5932
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df19582100f6907be3fdb9d2fcd5f583c674b57538abce8d69d98e4112dab6232e65e3e298347479698a32dace5c41d6f99e6bd1ca83e48955c75f41ec982624
|
7
|
+
data.tar.gz: 0ed13875d921f88edeb14a476b7bbd71342136e6d4f7a1b9ca83a17953951e949aa38ffc85e8792a4a48ecb774d3ad8387d4fe5aa48c757c0723830c06cb272c
|
data/Gemfile
CHANGED
data/config/cookstyle.yml
CHANGED
@@ -5,27 +5,6 @@ AllCops:
|
|
5
5
|
- '/**/files/**/*'
|
6
6
|
- '/**/vendor/**/*'
|
7
7
|
- Guardfile
|
8
|
-
ChefAttributes:
|
9
|
-
Patterns:
|
10
|
-
- attributes/.*\.rb
|
11
|
-
ChefDefinitions:
|
12
|
-
Patterns:
|
13
|
-
- definitions/.*\.rb
|
14
|
-
ChefLibraries:
|
15
|
-
Patterns:
|
16
|
-
- libraries/.*\.rb
|
17
|
-
ChefMetadata:
|
18
|
-
Patterns:
|
19
|
-
- metadata\.rb
|
20
|
-
ChefProviders:
|
21
|
-
Patterns:
|
22
|
-
- providers/.*\.rb
|
23
|
-
ChefRecipes:
|
24
|
-
Patterns:
|
25
|
-
- recipes/.*\.rb
|
26
|
-
ChefResources:
|
27
|
-
Patterns:
|
28
|
-
- resources/.*\.rb
|
29
8
|
|
30
9
|
###############################
|
31
10
|
# ChefStyle: Making cookbooks look better
|
@@ -67,7 +46,7 @@ ChefStyle/CommentFormat:
|
|
67
46
|
- '**/Berksfile'
|
68
47
|
|
69
48
|
ChefStyle/FileMode:
|
70
|
-
Description: Use strings to represent file modes
|
49
|
+
Description: Use strings to represent file modes to avoid confusion between octal and base 10 integer formats.
|
71
50
|
StyleGuide: '#chefstylefilemode'
|
72
51
|
Enabled: true
|
73
52
|
VersionAdded: '5.0.0'
|
@@ -231,14 +210,6 @@ ChefCorrectness/CookbookUsesNodeSave:
|
|
231
210
|
- '**/metadata.rb'
|
232
211
|
- '**/Berksfile'
|
233
212
|
|
234
|
-
ChefCorrectness/CookbooksDependsOnSelf:
|
235
|
-
Description: A cookbook cannot depend on itself
|
236
|
-
StyleGuide: '#chefcorrectnesscookbooksdependonself'
|
237
|
-
Enabled: true
|
238
|
-
VersionAdded: '5.2.0'
|
239
|
-
Include:
|
240
|
-
- '**/metadata.rb'
|
241
|
-
|
242
213
|
ChefCorrectness/MetadataMissingName:
|
243
214
|
Description: The metadata.rb file is missing the name field which is required by Chef Infra Client 12 and later
|
244
215
|
StyleGuide: '#chefcorrectnessmetadatamissingname'
|
@@ -471,6 +442,15 @@ ChefCorrectness/SupportsMustBeFloat:
|
|
471
442
|
Include:
|
472
443
|
- '**/metadata.rb'
|
473
444
|
|
445
|
+
ChefCorrectness/MacosUserdefaultsInvalidType:
|
446
|
+
Description: The macos_userdefaults resource prior to Chef Infra Client 16.3 would silently continue if invalid types were passed resulting in unexpected behavior. Valid values are 'array', 'bool', 'dict', 'float', 'int', and 'string'.
|
447
|
+
StyleGuide: '#chefcorrectnessmacosuserdefaultsinvalidtype'
|
448
|
+
Enabled: true
|
449
|
+
VersionAdded: '6.14.0'
|
450
|
+
Exclude:
|
451
|
+
- '**/metadata.rb'
|
452
|
+
- '**/Berksfile'
|
453
|
+
|
474
454
|
###############################
|
475
455
|
# ChefSharing: Issues that prevent sharing code with other teams or with the Chef community in general
|
476
456
|
###############################
|
@@ -515,7 +495,7 @@ ChefSharing/EmptyMetadataField:
|
|
515
495
|
- '**/metadata.rb'
|
516
496
|
|
517
497
|
ChefSharing/IncludePropertyDescriptions:
|
518
|
-
Description: Properties should include description fields to allow automated
|
498
|
+
Description: Properties should include description fields to allow automated documentation. Requires Chef Infra Client 13.9 or later.
|
519
499
|
StyleGuide: '#chefsharingincludepropetydescriptions'
|
520
500
|
Enabled: false
|
521
501
|
VersionAdded: '6.1.0'
|
@@ -524,7 +504,7 @@ ChefSharing/IncludePropertyDescriptions:
|
|
524
504
|
- '**/resources/*.rb'
|
525
505
|
|
526
506
|
ChefSharing/IncludeResourceDescriptions:
|
527
|
-
Description: Resources should include description fields to allow automated
|
507
|
+
Description: Resources should include description fields to allow automated documentation. Requires Chef Infra Client 13.9 or later.
|
528
508
|
StyleGuide: '#chefsharingincluderesourcedescriptions'
|
529
509
|
Enabled: false
|
530
510
|
VersionAdded: '6.1.0'
|
@@ -532,7 +512,7 @@ ChefSharing/IncludeResourceDescriptions:
|
|
532
512
|
- '**/resources/*.rb'
|
533
513
|
|
534
514
|
ChefSharing/IncludeResourceExamples:
|
535
|
-
Description: Resources should include examples field to allow automated
|
515
|
+
Description: Resources should include examples field to allow automated documentation. Requires Chef Infra Client 13.9 or later.
|
536
516
|
StyleGuide: '#chefsharingincluderesourceexamples'
|
537
517
|
Enabled: false
|
538
518
|
VersionAdded: '6.10.0'
|
@@ -1039,7 +1019,7 @@ ChefDeprecations/ResourceUsesOnlyResourceName:
|
|
1039
1019
|
|
1040
1020
|
ChefDeprecations/ChefDKGenerators:
|
1041
1021
|
Description: Chef Workstation 0.8 and later renamed the ChefDK module used when writing custom cookbook generators from ChefDK to ChefCLI. For compatibility with the latest Chef Workstation releases you'll need to reference the new class names.
|
1042
|
-
StyleGuide: '#
|
1022
|
+
StyleGuide: '#chefdeprecationschefdkgenerators'
|
1043
1023
|
Enabled: true
|
1044
1024
|
VersionAdded: '6.12.0'
|
1045
1025
|
Exclude:
|
@@ -1048,7 +1028,7 @@ ChefDeprecations/ChefDKGenerators:
|
|
1048
1028
|
|
1049
1029
|
ChefDeprecations/ChefHandlerRecipe:
|
1050
1030
|
Description: There is no need to include the empty and deprecated chef_handler::default recipe in order to use the chef_handler resource.
|
1051
|
-
StyleGuide: '#
|
1031
|
+
StyleGuide: '#chefdeprecationschefhandlerrecipe'
|
1052
1032
|
Enabled: true
|
1053
1033
|
VersionAdded: '6.12.0'
|
1054
1034
|
Exclude:
|
@@ -1057,13 +1037,31 @@ ChefDeprecations/ChefHandlerRecipe:
|
|
1057
1037
|
|
1058
1038
|
ChefDeprecations/UseAutomaticResourceName:
|
1059
1039
|
Description: The use_automatic_resource_name method was removed in Chef Infra Client 16. The resource name/provides should be set explicitly instead.
|
1060
|
-
StyleGuide: '#
|
1040
|
+
StyleGuide: '#chefdeprecationsuseautomaticresourcename'
|
1061
1041
|
Enabled: true
|
1062
1042
|
VersionAdded: '6.12.0'
|
1063
1043
|
Include:
|
1064
1044
|
- '**/libraries/*.rb'
|
1065
1045
|
- '**/resources/*.rb'
|
1066
1046
|
|
1047
|
+
ChefDeprecations/MacosUserdefaultsGlobalProperty:
|
1048
|
+
Description: The `global` property in the macos_userdefaults resource was deprecated in Chef Infra Client 16.3. Omitting the `domain` property will now set global defaults.
|
1049
|
+
StyleGuide: '#chefdeprecationsmacosuserdefaultsglobalproperty'
|
1050
|
+
Enabled: true
|
1051
|
+
VersionAdded: '6.14.0'
|
1052
|
+
Exclude:
|
1053
|
+
- '**/metadata.rb'
|
1054
|
+
- '**/Berksfile'
|
1055
|
+
|
1056
|
+
ChefDeprecations/CookbooksDependsOnSelf:
|
1057
|
+
Description: A cookbook cannot depend on itself in Chef Infra Client 13 or later.
|
1058
|
+
StyleGuide: '#chefdeprecationscookbooksdependonself'
|
1059
|
+
Enabled: true
|
1060
|
+
VersionAdded: '5.2.0'
|
1061
|
+
VersionChanged: '6.16.0'
|
1062
|
+
Include:
|
1063
|
+
- '**/metadata.rb'
|
1064
|
+
|
1067
1065
|
###############################
|
1068
1066
|
# ChefModernize: Cleaning up legacy code and using new built-in resources
|
1069
1067
|
###############################
|
@@ -1540,7 +1538,7 @@ ChefModernize/WindowsRegistryUAC:
|
|
1540
1538
|
- '**/Berksfile'
|
1541
1539
|
|
1542
1540
|
ChefModernize/UseMultipackageInstalls:
|
1543
|
-
Description: Pass an array of packages to package resources instead of
|
1541
|
+
Description: Pass an array of packages to package resources instead of iterating over an array of packages when using multi-package capable package subsystem such as apt, yum, chocolatey, dnf, or zypper. Multi-package installs are faster and simplify logs.
|
1544
1542
|
StyleGuide: '#chefmodernizeusemultipackageinstalls'
|
1545
1543
|
Enabled: true
|
1546
1544
|
VersionAdded: '6.0.0'
|
@@ -1873,7 +1871,7 @@ ChefEffortless/CookbookUsesDatabags:
|
|
1873
1871
|
- '**/metadata.rb'
|
1874
1872
|
- '**/Berksfile'
|
1875
1873
|
|
1876
|
-
ChefEffortless/
|
1874
|
+
ChefEffortless/CookbookUsesEnvironments:
|
1877
1875
|
Description: Cookbook uses environments, which cannot be used in the Effortless Infra pattern
|
1878
1876
|
StyleGuide: '#chefeffortlesscookbookusesenvironments'
|
1879
1877
|
Enabled: false
|
@@ -2209,10 +2207,6 @@ Style/WordArray:
|
|
2209
2207
|
Enabled: true
|
2210
2208
|
Style/ZeroLengthPredicate:
|
2211
2209
|
Enabled: true
|
2212
|
-
Metrics/BlockNesting:
|
2213
|
-
Enabled: true
|
2214
|
-
Metrics/ParameterLists:
|
2215
|
-
Enabled: true
|
2216
2210
|
Lint/AmbiguousOperator:
|
2217
2211
|
Enabled: true
|
2218
2212
|
Lint/AssignmentInCondition:
|
@@ -2344,16 +2338,16 @@ Metrics/CyclomaticComplexity:
|
|
2344
2338
|
Enabled: false
|
2345
2339
|
Metrics/PerceivedComplexity:
|
2346
2340
|
Enabled: false
|
2347
|
-
|
2348
|
-
|
2341
|
+
Metrics/BlockNesting:
|
2342
|
+
Enabled: false
|
2343
|
+
Metrics/ParameterLists:
|
2344
|
+
Enabled: false
|
2349
2345
|
|
2350
2346
|
# This updates how we send helpers into the Chef recipe/resource classes and makes WAY more sense
|
2351
2347
|
# Chef::Recipe.send(:include, ::Apt::Helpers) -> Chef::Recipe.include ::Apt::Helpers
|
2352
2348
|
Lint/SendWithMixinArgument:
|
2353
2349
|
Enabled: true
|
2354
2350
|
|
2355
|
-
#### END COPS FOR THE NEXT MAJOR RELEASE
|
2356
|
-
|
2357
2351
|
# this migrates old # rubocop: comments to use the latest namespaces, which prevents a ton of spam during cookstyle runs
|
2358
2352
|
Migration/DepartmentName:
|
2359
2353
|
Enabled: true
|
@@ -2578,3 +2572,44 @@ Style/HashEachMethods:
|
|
2578
2572
|
# We want to catch this deprecation in cookbooks
|
2579
2573
|
Lint/DeprecatedOpenSSLConstant:
|
2580
2574
|
Enabled: true
|
2575
|
+
|
2576
|
+
# This just isn't a big deal in the context of a cookbook
|
2577
|
+
Naming/AccessorMethodName:
|
2578
|
+
Enabled: false
|
2579
|
+
|
2580
|
+
# Rescuing a particular exception twice isn't going to work
|
2581
|
+
Lint/DuplicateRescueException:
|
2582
|
+
Enabled: true
|
2583
|
+
|
2584
|
+
# if b == 0 && b == 0 is invalid and we should flag it
|
2585
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
2586
|
+
Enabled: true
|
2587
|
+
|
2588
|
+
# returning at the top level with an arg is invalid
|
2589
|
+
# @TODO we can enable this once this is fixed: https://github.com/rubocop-hq/rubocop/issues/8462
|
2590
|
+
# Lint/TopLevelReturnWithArgument:
|
2591
|
+
# Enabled: true
|
2592
|
+
|
2593
|
+
# simplify hash acccess that doesn't actually need .dig
|
2594
|
+
Style/SingleArgumentDig:
|
2595
|
+
Enabled: true
|
2596
|
+
|
2597
|
+
# trying to access $2 when there is no $2 will always return nil
|
2598
|
+
Lint/OutOfRangeRegexpRef:
|
2599
|
+
Enabled: true
|
2600
|
+
|
2601
|
+
# simplify how people coerce arrays
|
2602
|
+
Style/ArrayCoercion:
|
2603
|
+
Enabled: true
|
2604
|
+
|
2605
|
+
# if your elseif is the same as your if you're gonna have a bad day
|
2606
|
+
Lint/DuplicateElsifCondition:
|
2607
|
+
Enabled: true
|
2608
|
+
|
2609
|
+
# simplify attr_reader and attr_write into attr_accessor
|
2610
|
+
Style/BisectedAttrAccessor:
|
2611
|
+
Enabled: true
|
2612
|
+
|
2613
|
+
# avoid assignments that aren't needed
|
2614
|
+
Style/RedundantAssignment:
|
2615
|
+
Enabled: true
|
data/config/disable_all.yml
CHANGED
@@ -53,6 +53,8 @@ Layout/EmptyLineAfterGuardClause:
|
|
53
53
|
Enabled: false
|
54
54
|
Layout/EmptyLineAfterMagicComment:
|
55
55
|
Enabled: false
|
56
|
+
Layout/EmptyLineAfterMultilineCondition:
|
57
|
+
Enabled: false
|
56
58
|
Layout/EmptyLineBetweenDefs:
|
57
59
|
Enabled: false
|
58
60
|
Layout/EmptyLinesAroundAccessModifier:
|
@@ -207,6 +209,8 @@ Lint/AssignmentInCondition:
|
|
207
209
|
Enabled: false
|
208
210
|
Lint/BigDecimalNew:
|
209
211
|
Enabled: false
|
212
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
213
|
+
Enabled: false
|
210
214
|
Lint/BooleanSymbol:
|
211
215
|
Enabled: false
|
212
216
|
Lint/CircularArgumentReference:
|
@@ -229,14 +233,22 @@ Lint/DuplicateHashKey:
|
|
229
233
|
Enabled: false
|
230
234
|
Lint/DuplicateMethods:
|
231
235
|
Enabled: false
|
236
|
+
Lint/DuplicateRequire:
|
237
|
+
Enabled: false
|
238
|
+
Lint/DuplicateRescueException:
|
239
|
+
Enabled: false
|
232
240
|
Lint/EachWithObjectArgument:
|
233
241
|
Enabled: false
|
234
242
|
Lint/ElseLayout:
|
235
243
|
Enabled: false
|
244
|
+
Lint/EmptyConditionalBody:
|
245
|
+
Enabled: false
|
236
246
|
Lint/EmptyEnsure:
|
237
247
|
Enabled: false
|
238
248
|
Lint/EmptyExpression:
|
239
249
|
Enabled: false
|
250
|
+
Lint/EmptyFile:
|
251
|
+
Enabled: false
|
240
252
|
Lint/EmptyInterpolation:
|
241
253
|
Enabled: false
|
242
254
|
Lint/EmptyWhen:
|
@@ -247,6 +259,8 @@ Lint/ErbNewArguments:
|
|
247
259
|
Enabled: false
|
248
260
|
Lint/FlipFlop:
|
249
261
|
Enabled: false
|
262
|
+
Lint/FloatComparison:
|
263
|
+
Enabled: false
|
250
264
|
Lint/FloatOutOfRange:
|
251
265
|
Enabled: false
|
252
266
|
Lint/FormatParameterMismatch:
|
@@ -269,6 +283,8 @@ Lint/Loop:
|
|
269
283
|
Enabled: false
|
270
284
|
Lint/MissingCopEnableDirective:
|
271
285
|
Enabled: false
|
286
|
+
Lint/MissingSuper:
|
287
|
+
Enabled: false
|
272
288
|
Lint/MixedRegexpCaptureTypes:
|
273
289
|
Enabled: false
|
274
290
|
Lint/MultipleComparison:
|
@@ -287,6 +303,8 @@ Lint/NumberConversion:
|
|
287
303
|
Enabled: false
|
288
304
|
Lint/OrderedMagicComments:
|
289
305
|
Enabled: false
|
306
|
+
Lint/OutOfRangeRegexpRef:
|
307
|
+
Enabled: false
|
290
308
|
Lint/ParenthesesAsGroupedExpression:
|
291
309
|
Enabled: false
|
292
310
|
Lint/PercentStringArray:
|
@@ -329,6 +347,8 @@ Lint/SafeNavigationWithEmpty:
|
|
329
347
|
Enabled: false
|
330
348
|
Lint/ScriptPermission:
|
331
349
|
Enabled: false
|
350
|
+
Lint/SelfAssignment:
|
351
|
+
Enabled: false
|
332
352
|
Lint/SendWithMixinArgument:
|
333
353
|
Enabled: false
|
334
354
|
Lint/ShadowedArgument:
|
@@ -345,12 +365,18 @@ Lint/Syntax:
|
|
345
365
|
Enabled: false
|
346
366
|
Lint/ToJSON:
|
347
367
|
Enabled: false
|
368
|
+
Lint/TopLevelReturnWithArgument:
|
369
|
+
Enabled: false
|
370
|
+
Lint/TrailingCommaInAttributeDeclaration:
|
371
|
+
Enabled: false
|
348
372
|
Lint/UnderscorePrefixedVariableName:
|
349
373
|
Enabled: false
|
350
374
|
Lint/UnifiedInteger:
|
351
375
|
Enabled: false
|
352
376
|
Lint/UnreachableCode:
|
353
377
|
Enabled: false
|
378
|
+
Lint/UnreachableLoop:
|
379
|
+
Enabled: false
|
354
380
|
Lint/UnusedBlockArgument:
|
355
381
|
Enabled: false
|
356
382
|
Lint/UnusedMethodArgument:
|
@@ -363,10 +389,10 @@ Lint/UselessAccessModifier:
|
|
363
389
|
Enabled: false
|
364
390
|
Lint/UselessAssignment:
|
365
391
|
Enabled: false
|
366
|
-
Lint/UselessComparison:
|
367
|
-
Enabled: false
|
368
392
|
Lint/UselessElseWithoutRescue:
|
369
393
|
Enabled: false
|
394
|
+
Lint/UselessMethodDefinition:
|
395
|
+
Enabled: false
|
370
396
|
Lint/UselessSetterCall:
|
371
397
|
Enabled: false
|
372
398
|
Lint/Void:
|
@@ -461,6 +487,8 @@ Style/ClassCheck:
|
|
461
487
|
Enabled: false
|
462
488
|
Style/ClassMethods:
|
463
489
|
Enabled: false
|
490
|
+
Style/ClassMethodsDefinitions:
|
491
|
+
Enabled: false
|
464
492
|
Style/ClassVars:
|
465
493
|
Enabled: false
|
466
494
|
Style/CollectionMethods:
|
@@ -469,6 +497,8 @@ Style/ColonMethodCall:
|
|
469
497
|
Enabled: false
|
470
498
|
Style/ColonMethodDefinition:
|
471
499
|
Enabled: false
|
500
|
+
Style/CombinableLoops:
|
501
|
+
Enabled: false
|
472
502
|
Style/CommandLiteral:
|
473
503
|
Enabled: false
|
474
504
|
Style/CommentAnnotation:
|
@@ -523,6 +553,8 @@ Style/EvenOdd:
|
|
523
553
|
Enabled: false
|
524
554
|
Style/ExpandPathArguments:
|
525
555
|
Enabled: false
|
556
|
+
Style/ExplicitBlockArgument:
|
557
|
+
Enabled: false
|
526
558
|
Style/ExponentialNotation:
|
527
559
|
Enabled: false
|
528
560
|
Style/FloatDivision:
|
@@ -535,6 +567,8 @@ Style/FormatStringToken:
|
|
535
567
|
Enabled: false
|
536
568
|
Style/FrozenStringLiteralComment:
|
537
569
|
Enabled: false
|
570
|
+
Style/GlobalStdStream:
|
571
|
+
Enabled: false
|
538
572
|
Style/GlobalVars:
|
539
573
|
Enabled: false
|
540
574
|
Style/GuardClause:
|
@@ -571,6 +605,8 @@ Style/InlineComment:
|
|
571
605
|
Enabled: false
|
572
606
|
Style/IpAddresses:
|
573
607
|
Enabled: false
|
608
|
+
Style/KeywordParametersOrder:
|
609
|
+
Enabled: false
|
574
610
|
Style/Lambda:
|
575
611
|
Enabled: false
|
576
612
|
Style/LambdaCall:
|
@@ -587,12 +623,14 @@ Style/RedundantFetchBlock:
|
|
587
623
|
Enabled: false
|
588
624
|
Style/RedundantFileExtensionInRequire:
|
589
625
|
Enabled: false
|
626
|
+
Style/RedundantSelfAssignment:
|
627
|
+
Enabled: false
|
628
|
+
Style/SoleNestedConditional:
|
629
|
+
Enabled: false
|
590
630
|
Style/MethodCalledOnDoEndBlock:
|
591
631
|
Enabled: false
|
592
632
|
Style/MethodDefParentheses:
|
593
633
|
Enabled: false
|
594
|
-
Style/MethodMissingSuper:
|
595
|
-
Enabled: false
|
596
634
|
Style/MinMax:
|
597
635
|
Enabled: false
|
598
636
|
Style/MissingElse:
|
@@ -657,6 +695,8 @@ Style/OptionHash:
|
|
657
695
|
Enabled: false
|
658
696
|
Style/OptionalArguments:
|
659
697
|
Enabled: false
|
698
|
+
Style/OptionalBooleanParameter:
|
699
|
+
Enabled: false
|
660
700
|
Style/ParallelAssignment:
|
661
701
|
Enabled: false
|
662
702
|
Style/ParenthesesAroundCondition:
|
@@ -725,6 +765,8 @@ Style/Send:
|
|
725
765
|
Enabled: false
|
726
766
|
Style/SignalException:
|
727
767
|
Enabled: false
|
768
|
+
Style/SingleArgumentDig:
|
769
|
+
Enabled: false
|
728
770
|
Style/SingleLineBlockParams:
|
729
771
|
Enabled: false
|
730
772
|
Style/SingleLineMethods:
|
@@ -737,6 +779,8 @@ Style/StabbyLambdaParentheses:
|
|
737
779
|
Enabled: false
|
738
780
|
Style/StderrPuts:
|
739
781
|
Enabled: false
|
782
|
+
Style/StringConcatenation:
|
783
|
+
Enabled: false
|
740
784
|
Style/StringHashKeys:
|
741
785
|
Enabled: false
|
742
786
|
Style/StringLiterals:
|
data/config/upstream.yml
CHANGED
@@ -210,9 +210,10 @@ Gemspec/OrderedDependencies:
|
|
210
210
|
- '**/*.gemspec'
|
211
211
|
|
212
212
|
Gemspec/RequiredRubyVersion:
|
213
|
-
Description: 'Checks that `required_ruby_version` of gemspec and `TargetRubyVersion` of .rubocop.yml
|
213
|
+
Description: 'Checks that `required_ruby_version` of gemspec is specified and equal to `TargetRubyVersion` of .rubocop.yml.'
|
214
214
|
Enabled: true
|
215
215
|
VersionAdded: '0.52'
|
216
|
+
VersionChanged: '0.89'
|
216
217
|
Include:
|
217
218
|
- '**/*.gemspec'
|
218
219
|
|
@@ -398,7 +399,6 @@ Layout/DefEndAlignment:
|
|
398
399
|
SupportedStylesAlignWith:
|
399
400
|
- start_of_line
|
400
401
|
- def
|
401
|
-
AutoCorrect: false
|
402
402
|
Severity: warning
|
403
403
|
|
404
404
|
Layout/DotPosition:
|
@@ -435,6 +435,14 @@ Layout/EmptyLineAfterMagicComment:
|
|
435
435
|
Enabled: true
|
436
436
|
VersionAdded: '0.49'
|
437
437
|
|
438
|
+
Layout/EmptyLineAfterMultilineCondition:
|
439
|
+
Description: 'Enforces empty line after multiline condition.'
|
440
|
+
# This is disabled, because this style is not very common in practice.
|
441
|
+
Enabled: false
|
442
|
+
VersionAdded: '0.90'
|
443
|
+
Reference:
|
444
|
+
- https://github.com/airbnb/ruby#multiline-if-newline
|
445
|
+
|
438
446
|
Layout/EmptyLineBetweenDefs:
|
439
447
|
Description: 'Use empty lines between defs.'
|
440
448
|
StyleGuide: '#empty-lines-between-methods'
|
@@ -554,7 +562,6 @@ Layout/EndAlignment:
|
|
554
562
|
- keyword
|
555
563
|
- variable
|
556
564
|
- start_of_line
|
557
|
-
AutoCorrect: false
|
558
565
|
Severity: warning
|
559
566
|
|
560
567
|
Layout/EndOfLine:
|
@@ -1234,7 +1241,7 @@ Layout/SpaceInsideBlockBraces:
|
|
1234
1241
|
|
1235
1242
|
Layout/SpaceInsideHashLiteralBraces:
|
1236
1243
|
Description: "Use spaces inside hash literal braces - or don't."
|
1237
|
-
StyleGuide: '#spaces-
|
1244
|
+
StyleGuide: '#spaces-braces'
|
1238
1245
|
Enabled: true
|
1239
1246
|
VersionAdded: '0.49'
|
1240
1247
|
EnforcedStyle: space
|
@@ -1355,6 +1362,12 @@ Lint/BigDecimalNew:
|
|
1355
1362
|
Enabled: true
|
1356
1363
|
VersionAdded: '0.53'
|
1357
1364
|
|
1365
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
1366
|
+
Description: 'This cop checks for places where binary operator has identical operands.'
|
1367
|
+
Enabled: pending
|
1368
|
+
Safe: false
|
1369
|
+
VersionAdded: '0.89'
|
1370
|
+
|
1358
1371
|
Lint/BooleanSymbol:
|
1359
1372
|
Description: 'Check for `:true` and `:false` symbols.'
|
1360
1373
|
Enabled: true
|
@@ -1420,6 +1433,16 @@ Lint/DuplicateMethods:
|
|
1420
1433
|
Enabled: true
|
1421
1434
|
VersionAdded: '0.29'
|
1422
1435
|
|
1436
|
+
Lint/DuplicateRequire:
|
1437
|
+
Description: 'Check for duplicate `require`s and `require_relative`s.'
|
1438
|
+
Enabled: pending
|
1439
|
+
VersionAdded: '0.90'
|
1440
|
+
|
1441
|
+
Lint/DuplicateRescueException:
|
1442
|
+
Description: 'Checks that there are no repeated exceptions used in `rescue` expressions.'
|
1443
|
+
Enabled: pending
|
1444
|
+
VersionAdded: '0.89'
|
1445
|
+
|
1423
1446
|
Lint/EachWithObjectArgument:
|
1424
1447
|
Description: 'Check for immutable argument given to each_with_object.'
|
1425
1448
|
Enabled: true
|
@@ -1430,18 +1453,29 @@ Lint/ElseLayout:
|
|
1430
1453
|
Enabled: true
|
1431
1454
|
VersionAdded: '0.17'
|
1432
1455
|
|
1456
|
+
Lint/EmptyConditionalBody:
|
1457
|
+
Description: 'This cop checks for the presence of `if`, `elsif` and `unless` branches without a body.'
|
1458
|
+
Enabled: 'pending'
|
1459
|
+
AllowComments: true
|
1460
|
+
VersionAdded: '0.89'
|
1461
|
+
|
1433
1462
|
Lint/EmptyEnsure:
|
1434
1463
|
Description: 'Checks for empty ensure block.'
|
1435
1464
|
Enabled: true
|
1436
1465
|
VersionAdded: '0.10'
|
1437
1466
|
VersionChanged: '0.48'
|
1438
|
-
AutoCorrect: false
|
1439
1467
|
|
1440
1468
|
Lint/EmptyExpression:
|
1441
1469
|
Description: 'Checks for empty expressions.'
|
1442
1470
|
Enabled: true
|
1443
1471
|
VersionAdded: '0.45'
|
1444
1472
|
|
1473
|
+
Lint/EmptyFile:
|
1474
|
+
Description: 'Enforces that Ruby source files are not empty.'
|
1475
|
+
Enabled: pending
|
1476
|
+
AllowComments: true
|
1477
|
+
VersionAdded: '0.90'
|
1478
|
+
|
1445
1479
|
Lint/EmptyInterpolation:
|
1446
1480
|
Description: 'Checks for empty string interpolation.'
|
1447
1481
|
Enabled: true
|
@@ -1473,6 +1507,12 @@ Lint/FlipFlop:
|
|
1473
1507
|
Enabled: true
|
1474
1508
|
VersionAdded: '0.16'
|
1475
1509
|
|
1510
|
+
Lint/FloatComparison:
|
1511
|
+
Description: 'Checks for the presence of precise comparison of floating point numbers.'
|
1512
|
+
StyleGuide: '#float-comparison'
|
1513
|
+
Enabled: pending
|
1514
|
+
VersionAdded: '0.89'
|
1515
|
+
|
1476
1516
|
Lint/FloatOutOfRange:
|
1477
1517
|
Description: >-
|
1478
1518
|
Catches floating-point literals too large or small for Ruby to
|
@@ -1520,7 +1560,7 @@ Lint/InheritException:
|
|
1520
1560
|
Lint/InterpolationCheck:
|
1521
1561
|
Description: 'Raise warning for interpolation in single q strs.'
|
1522
1562
|
Enabled: true
|
1523
|
-
|
1563
|
+
Safe: false
|
1524
1564
|
VersionAdded: '0.50'
|
1525
1565
|
VersionChanged: '0.87'
|
1526
1566
|
|
@@ -1542,6 +1582,7 @@ Lint/Loop:
|
|
1542
1582
|
StyleGuide: '#loop-with-break'
|
1543
1583
|
Enabled: true
|
1544
1584
|
VersionAdded: '0.9'
|
1585
|
+
VersionChanged: '0.89'
|
1545
1586
|
|
1546
1587
|
Lint/MissingCopEnableDirective:
|
1547
1588
|
Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`.'
|
@@ -1556,6 +1597,13 @@ Lint/MissingCopEnableDirective:
|
|
1556
1597
|
# .inf for any size
|
1557
1598
|
MaximumRangeSize: .inf
|
1558
1599
|
|
1600
|
+
Lint/MissingSuper:
|
1601
|
+
Description: >-
|
1602
|
+
This cop checks for the presence of constructors and lifecycle callbacks
|
1603
|
+
without calls to `super`'.
|
1604
|
+
Enabled: pending
|
1605
|
+
VersionAdded: '0.89'
|
1606
|
+
|
1559
1607
|
Lint/MixedRegexpCaptureTypes:
|
1560
1608
|
Description: 'Do not mix named captures and numbered captures in a Regexp literal.'
|
1561
1609
|
Enabled: pending
|
@@ -1608,6 +1656,12 @@ Lint/OrderedMagicComments:
|
|
1608
1656
|
Enabled: true
|
1609
1657
|
VersionAdded: '0.53'
|
1610
1658
|
|
1659
|
+
Lint/OutOfRangeRegexpRef:
|
1660
|
+
Description: 'Checks for out of range reference for Regexp because it always returns nil.'
|
1661
|
+
Enabled: pending
|
1662
|
+
Safe: false
|
1663
|
+
VersionAdded: '0.89'
|
1664
|
+
|
1611
1665
|
Lint/ParenthesesAsGroupedExpression:
|
1612
1666
|
Description: >-
|
1613
1667
|
Checks for method calls with a space before the opening
|
@@ -1758,6 +1812,11 @@ Lint/ScriptPermission:
|
|
1758
1812
|
VersionAdded: '0.49'
|
1759
1813
|
VersionChanged: '0.50'
|
1760
1814
|
|
1815
|
+
Lint/SelfAssignment:
|
1816
|
+
Description: 'Checks for self-assignments.'
|
1817
|
+
Enabled: pending
|
1818
|
+
VersionAdded: '0.89'
|
1819
|
+
|
1761
1820
|
Lint/SendWithMixinArgument:
|
1762
1821
|
Description: 'Checks for `send` method when using mixin.'
|
1763
1822
|
Enabled: true
|
@@ -1808,6 +1867,16 @@ Lint/ToJSON:
|
|
1808
1867
|
Enabled: true
|
1809
1868
|
VersionAdded: '0.66'
|
1810
1869
|
|
1870
|
+
Lint/TopLevelReturnWithArgument:
|
1871
|
+
Description: 'This cop detects top level return statements with argument.'
|
1872
|
+
Enabled: 'pending'
|
1873
|
+
VersionAdded: '0.89'
|
1874
|
+
|
1875
|
+
Lint/TrailingCommaInAttributeDeclaration:
|
1876
|
+
Description: 'This cop checks for trailing commas in attribute declarations.'
|
1877
|
+
Enabled: pending
|
1878
|
+
VersionAdded: '0.90'
|
1879
|
+
|
1811
1880
|
Lint/UnderscorePrefixedVariableName:
|
1812
1881
|
Description: 'Do not use prefix `_` for a variable that is used.'
|
1813
1882
|
Enabled: true
|
@@ -1824,6 +1893,11 @@ Lint/UnreachableCode:
|
|
1824
1893
|
Enabled: true
|
1825
1894
|
VersionAdded: '0.9'
|
1826
1895
|
|
1896
|
+
Lint/UnreachableLoop:
|
1897
|
+
Description: 'This cop checks for loops that will have at most one iteration.'
|
1898
|
+
Enabled: pending
|
1899
|
+
VersionAdded: '0.89'
|
1900
|
+
|
1827
1901
|
Lint/UnusedBlockArgument:
|
1828
1902
|
Description: 'Checks for unused block arguments.'
|
1829
1903
|
StyleGuide: '#underscore-unused-vars'
|
@@ -1873,16 +1947,18 @@ Lint/UselessAssignment:
|
|
1873
1947
|
Enabled: true
|
1874
1948
|
VersionAdded: '0.11'
|
1875
1949
|
|
1876
|
-
Lint/UselessComparison:
|
1877
|
-
Description: 'Checks for comparison of something with itself.'
|
1878
|
-
Enabled: true
|
1879
|
-
VersionAdded: '0.11'
|
1880
|
-
|
1881
1950
|
Lint/UselessElseWithoutRescue:
|
1882
1951
|
Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
|
1883
1952
|
Enabled: true
|
1884
1953
|
VersionAdded: '0.17'
|
1885
1954
|
|
1955
|
+
Lint/UselessMethodDefinition:
|
1956
|
+
Description: 'Checks for useless method definitions.'
|
1957
|
+
Enabled: pending
|
1958
|
+
VersionAdded: '0.90'
|
1959
|
+
Safe: false
|
1960
|
+
AllowComments: true
|
1961
|
+
|
1886
1962
|
Lint/UselessSetterCall:
|
1887
1963
|
Description: 'Checks for useless setter call to a local variable.'
|
1888
1964
|
Enabled: true
|
@@ -1911,7 +1987,7 @@ Metrics/AbcSize:
|
|
1911
1987
|
# The ABC size is a calculated magnitude, so this number can be an Integer or
|
1912
1988
|
# a Float.
|
1913
1989
|
IgnoredMethods: []
|
1914
|
-
Max:
|
1990
|
+
Max: 17
|
1915
1991
|
|
1916
1992
|
Metrics/BlockLength:
|
1917
1993
|
Description: 'Avoid long blocks with many lines.'
|
@@ -1993,7 +2069,7 @@ Metrics/PerceivedComplexity:
|
|
1993
2069
|
VersionAdded: '0.25'
|
1994
2070
|
VersionChanged: '0.81'
|
1995
2071
|
IgnoredMethods: []
|
1996
|
-
Max:
|
2072
|
+
Max: 8
|
1997
2073
|
|
1998
2074
|
################## Migration #############################
|
1999
2075
|
|
@@ -2352,6 +2428,7 @@ Style/ArrayCoercion:
|
|
2352
2428
|
Use Array() instead of explicit Array check or [*var], when dealing
|
2353
2429
|
with a variable you want to treat as an Array, but you're not certain it's an array.
|
2354
2430
|
StyleGuide: '#array-coercion'
|
2431
|
+
Safe: false
|
2355
2432
|
Enabled: 'pending'
|
2356
2433
|
VersionAdded: '0.88'
|
2357
2434
|
|
@@ -2527,6 +2604,7 @@ Style/CaseEquality:
|
|
2527
2604
|
StyleGuide: '#no-case-equality'
|
2528
2605
|
Enabled: true
|
2529
2606
|
VersionAdded: '0.9'
|
2607
|
+
VersionChanged: '0.89'
|
2530
2608
|
# If AllowOnConstant is enabled, the cop will ignore violations when the receiver of
|
2531
2609
|
# the case equality operator is a constant.
|
2532
2610
|
#
|
@@ -2541,6 +2619,7 @@ Style/CaseLikeIf:
|
|
2541
2619
|
Description: 'This cop identifies places where `if-elsif` constructions can be replaced with `case-when`.'
|
2542
2620
|
StyleGuide: '#case-vs-if-else'
|
2543
2621
|
Enabled: 'pending'
|
2622
|
+
Safe: false
|
2544
2623
|
VersionAdded: '0.88'
|
2545
2624
|
|
2546
2625
|
Style/CharacterLiteral:
|
@@ -2558,7 +2637,6 @@ Style/ClassAndModuleChildren:
|
|
2558
2637
|
# have the knowledge to perform either operation safely and thus requires
|
2559
2638
|
# manual oversight.
|
2560
2639
|
SafeAutoCorrect: false
|
2561
|
-
AutoCorrect: false
|
2562
2640
|
Enabled: true
|
2563
2641
|
VersionAdded: '0.19'
|
2564
2642
|
#
|
@@ -2597,6 +2675,16 @@ Style/ClassMethods:
|
|
2597
2675
|
VersionAdded: '0.9'
|
2598
2676
|
VersionChanged: '0.20'
|
2599
2677
|
|
2678
|
+
Style/ClassMethodsDefinitions:
|
2679
|
+
Description: 'Enforces using `def self.method_name` or `class << self` to define class methods.'
|
2680
|
+
StyleGuide: '#def-self-class-methods'
|
2681
|
+
Enabled: false
|
2682
|
+
VersionAdded: '0.89'
|
2683
|
+
EnforcedStyle: def_self
|
2684
|
+
SupportedStyles:
|
2685
|
+
- def_self
|
2686
|
+
- self_class
|
2687
|
+
|
2600
2688
|
Style/ClassVars:
|
2601
2689
|
Description: 'Avoid the use of class variables.'
|
2602
2690
|
StyleGuide: '#no-class-vars'
|
@@ -2637,6 +2725,14 @@ Style/ColonMethodDefinition:
|
|
2637
2725
|
Enabled: true
|
2638
2726
|
VersionAdded: '0.52'
|
2639
2727
|
|
2728
|
+
Style/CombinableLoops:
|
2729
|
+
Description: >-
|
2730
|
+
Checks for places where multiple consecutive loops over the same data
|
2731
|
+
can be combined into a single loop.
|
2732
|
+
Enabled: pending
|
2733
|
+
Safe: false
|
2734
|
+
VersionAdded: '0.90'
|
2735
|
+
|
2640
2736
|
Style/CommandLiteral:
|
2641
2737
|
Description: 'Use `` or %x around command literals.'
|
2642
2738
|
StyleGuide: '#percent-x'
|
@@ -2880,6 +2976,16 @@ Style/ExpandPathArguments:
|
|
2880
2976
|
Enabled: true
|
2881
2977
|
VersionAdded: '0.53'
|
2882
2978
|
|
2979
|
+
Style/ExplicitBlockArgument:
|
2980
|
+
Description: >-
|
2981
|
+
Consider using explicit block argument to avoid writing block literal
|
2982
|
+
that just passes its arguments to another block.
|
2983
|
+
StyleGuide: '#block-argument'
|
2984
|
+
Enabled: pending
|
2985
|
+
# May change the yielding arity.
|
2986
|
+
Safe: false
|
2987
|
+
VersionAdded: '0.89'
|
2988
|
+
|
2883
2989
|
Style/ExponentialNotation:
|
2884
2990
|
Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
|
2885
2991
|
StyleGuide: '#exponential-notation'
|
@@ -2961,7 +3067,13 @@ Style/FrozenStringLiteralComment:
|
|
2961
3067
|
# `never` will enforce that the frozen string literal comment does not
|
2962
3068
|
# exist in a file.
|
2963
3069
|
- never
|
2964
|
-
|
3070
|
+
SafeAutoCorrect: false
|
3071
|
+
|
3072
|
+
Style/GlobalStdStream:
|
3073
|
+
Description: 'Enforces the use of `$stdout/$stderr/$stdin` instead of `STDOUT/STDERR/STDIN`.'
|
3074
|
+
StyleGuide: '#global-stdout'
|
3075
|
+
Enabled: pending
|
3076
|
+
VersionAdded: '0.89'
|
2965
3077
|
|
2966
3078
|
Style/GlobalVars:
|
2967
3079
|
Description: 'Do not introduce global variables.'
|
@@ -3035,15 +3147,17 @@ Style/HashSyntax:
|
|
3035
3147
|
PreferHashRocketsForNonAlnumEndingSymbols: false
|
3036
3148
|
|
3037
3149
|
Style/HashTransformKeys:
|
3038
|
-
Description: 'Prefer `transform_keys` over `each_with_object`
|
3150
|
+
Description: 'Prefer `transform_keys` over `each_with_object`, `map`, or `to_h`.'
|
3039
3151
|
Enabled: 'pending'
|
3040
3152
|
VersionAdded: '0.80'
|
3153
|
+
VersionChanged: '0.90'
|
3041
3154
|
Safe: false
|
3042
3155
|
|
3043
3156
|
Style/HashTransformValues:
|
3044
|
-
Description: 'Prefer `transform_values` over `each_with_object`
|
3157
|
+
Description: 'Prefer `transform_values` over `each_with_object`, `map`, or `to_h`.'
|
3045
3158
|
Enabled: 'pending'
|
3046
3159
|
VersionAdded: '0.80'
|
3160
|
+
VersionChanged: '0.90'
|
3047
3161
|
Safe: false
|
3048
3162
|
|
3049
3163
|
Style/IdenticalConditionalBranches:
|
@@ -3140,6 +3254,12 @@ Style/IpAddresses:
|
|
3140
3254
|
- "::"
|
3141
3255
|
# :: is a valid IPv6 address, but could potentially be legitimately in code
|
3142
3256
|
|
3257
|
+
Style/KeywordParametersOrder:
|
3258
|
+
Description: 'Enforces that optional keyword parameters are placed at the end of the parameters list.'
|
3259
|
+
StyleGuide: '#keyword-parameters-order'
|
3260
|
+
Enabled: pending
|
3261
|
+
VersionAdded: '0.90'
|
3262
|
+
|
3143
3263
|
Style/Lambda:
|
3144
3264
|
Description: 'Use the new lambda literal syntax for single-line blocks.'
|
3145
3265
|
StyleGuide: '#lambda-multi-line'
|
@@ -3218,12 +3338,6 @@ Style/MethodDefParentheses:
|
|
3218
3338
|
- require_no_parentheses
|
3219
3339
|
- require_no_parentheses_except_multiline
|
3220
3340
|
|
3221
|
-
Style/MethodMissingSuper:
|
3222
|
-
Description: Checks for `method_missing` to call `super`.
|
3223
|
-
StyleGuide: '#no-method-missing'
|
3224
|
-
Enabled: true
|
3225
|
-
VersionAdded: '0.56'
|
3226
|
-
|
3227
3341
|
Style/MinMax:
|
3228
3342
|
Description: >-
|
3229
3343
|
Use `Enumerable#minmax` instead of `Enumerable#min`
|
@@ -3519,7 +3633,6 @@ Style/NumericPredicate:
|
|
3519
3633
|
# object. Switching these methods has to be done with knowledge of the types
|
3520
3634
|
# of the variables which rubocop doesn't have.
|
3521
3635
|
SafeAutoCorrect: false
|
3522
|
-
AutoCorrect: false
|
3523
3636
|
Enabled: true
|
3524
3637
|
VersionAdded: '0.42'
|
3525
3638
|
VersionChanged: '0.59'
|
@@ -3535,12 +3648,13 @@ Style/NumericPredicate:
|
|
3535
3648
|
|
3536
3649
|
Style/OneLineConditional:
|
3537
3650
|
Description: >-
|
3538
|
-
Favor the ternary operator(?:) over
|
3539
|
-
if/then/else/end constructs.
|
3651
|
+
Favor the ternary operator (?:) or multi-line constructs over
|
3652
|
+
single-line if/then/else/end constructs.
|
3540
3653
|
StyleGuide: '#ternary-operator'
|
3541
3654
|
Enabled: true
|
3655
|
+
AlwaysCorrectToMultiline: false
|
3542
3656
|
VersionAdded: '0.9'
|
3543
|
-
VersionChanged: '0.
|
3657
|
+
VersionChanged: '0.90'
|
3544
3658
|
|
3545
3659
|
Style/OptionHash:
|
3546
3660
|
Description: "Don't use option hashes when you can use keyword arguments."
|
@@ -3565,6 +3679,13 @@ Style/OptionalArguments:
|
|
3565
3679
|
VersionAdded: '0.33'
|
3566
3680
|
VersionChanged: '0.83'
|
3567
3681
|
|
3682
|
+
Style/OptionalBooleanParameter:
|
3683
|
+
Description: 'Use keyword arguments when defining method with boolean argument.'
|
3684
|
+
StyleGuide: '#boolean-keyword-arguments'
|
3685
|
+
Enabled: pending
|
3686
|
+
Safe: false
|
3687
|
+
VersionAdded: '0.89'
|
3688
|
+
|
3568
3689
|
Style/OrAssignment:
|
3569
3690
|
Description: 'Recommend usage of double pipe equals (||=) where applicable.'
|
3570
3691
|
StyleGuide: '#double-pipe-for-uninit'
|
@@ -3764,6 +3885,12 @@ Style/RedundantSelf:
|
|
3764
3885
|
VersionAdded: '0.10'
|
3765
3886
|
VersionChanged: '0.13'
|
3766
3887
|
|
3888
|
+
Style/RedundantSelfAssignment:
|
3889
|
+
Description: 'Checks for places where redundant assignments are made for in place modification methods.'
|
3890
|
+
Enabled: pending
|
3891
|
+
Safe: false
|
3892
|
+
VersionAdded: '0.90'
|
3893
|
+
|
3767
3894
|
Style/RedundantSort:
|
3768
3895
|
Description: >-
|
3769
3896
|
Use `min` instead of `sort.first`,
|
@@ -3883,6 +4010,12 @@ Style/SignalException:
|
|
3883
4010
|
- only_fail
|
3884
4011
|
- semantic
|
3885
4012
|
|
4013
|
+
Style/SingleArgumentDig:
|
4014
|
+
Description: 'Avoid using single argument dig method.'
|
4015
|
+
Enabled: pending
|
4016
|
+
VersionAdded: '0.89'
|
4017
|
+
Safe: false
|
4018
|
+
|
3886
4019
|
Style/SingleLineBlockParams:
|
3887
4020
|
Description: 'Enforces the names of some block params.'
|
3888
4021
|
Enabled: false
|
@@ -3910,6 +4043,14 @@ Style/SlicingWithRange:
|
|
3910
4043
|
VersionAdded: '0.83'
|
3911
4044
|
Safe: false
|
3912
4045
|
|
4046
|
+
Style/SoleNestedConditional:
|
4047
|
+
Description: >-
|
4048
|
+
Finds sole nested conditional nodes
|
4049
|
+
which can be merged into outer conditional node.
|
4050
|
+
Enabled: pending
|
4051
|
+
VersionAdded: '0.89'
|
4052
|
+
AllowModifier: false
|
4053
|
+
|
3913
4054
|
Style/SpecialGlobalVars:
|
3914
4055
|
Description: 'Avoid Perl-style global variables.'
|
3915
4056
|
StyleGuide: '#no-cryptic-perlisms'
|
@@ -3938,6 +4079,13 @@ Style/StderrPuts:
|
|
3938
4079
|
Enabled: true
|
3939
4080
|
VersionAdded: '0.51'
|
3940
4081
|
|
4082
|
+
Style/StringConcatenation:
|
4083
|
+
Description: 'Checks for places where string concatenation can be replaced with string interpolation.'
|
4084
|
+
StyleGuide: '#string-interpolation'
|
4085
|
+
Enabled: pending
|
4086
|
+
Safe: false
|
4087
|
+
VersionAdded: '0.89'
|
4088
|
+
|
3941
4089
|
Style/StringHashKeys:
|
3942
4090
|
Description: 'Prefer symbols instead of strings as hash keys.'
|
3943
4091
|
StyleGuide: '#symbols-as-keys'
|