cookstyle 7.32.2 → 7.32.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. checksums.yaml +4 -4
  2. data/bin/cookstyle +7 -0
  3. data/config/chefstyle.yml +741 -0
  4. data/config/cookstyle.yml +46 -46
  5. data/config/default.yml +0 -2
  6. data/lib/cookstyle/version.rb +1 -1
  7. data/lib/cookstyle.rb +7 -15
  8. data/lib/rubocop/cop/chef/correctness/block_guard_clause_string_only.rb +2 -2
  9. data/lib/rubocop/cop/chef/correctness/chef_application_fatal.rb +2 -2
  10. data/lib/rubocop/cop/chef/correctness/conditional_ruby_shellout.rb +2 -2
  11. data/lib/rubocop/cop/chef/correctness/dnf_package_allow_downgrades.rb +2 -2
  12. data/lib/rubocop/cop/chef/correctness/incorrect_library_injection.rb +2 -2
  13. data/lib/rubocop/cop/chef/correctness/invalid_cookbook_name.rb +2 -2
  14. data/lib/rubocop/cop/chef/correctness/invalid_default_action.rb +2 -2
  15. data/lib/rubocop/cop/chef/correctness/invalid_notification_resource.rb +2 -2
  16. data/lib/rubocop/cop/chef/correctness/invalid_notification_timing.rb +2 -2
  17. data/lib/rubocop/cop/chef/correctness/invalid_platform_family_helper.rb +2 -2
  18. data/lib/rubocop/cop/chef/correctness/invalid_platform_family_values_in_case.rb +1 -1
  19. data/lib/rubocop/cop/chef/correctness/invalid_platform_helper.rb +2 -2
  20. data/lib/rubocop/cop/chef/correctness/invalid_platform_metadata.rb +2 -2
  21. data/lib/rubocop/cop/chef/correctness/invalid_platform_values_in_case.rb +1 -1
  22. data/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_family_helper.rb +2 -2
  23. data/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_helper.rb +2 -2
  24. data/lib/rubocop/cop/chef/correctness/invalid_version_metadata.rb +2 -2
  25. data/lib/rubocop/cop/chef/correctness/lazy_eval_node_attribute_defaults.rb +2 -2
  26. data/lib/rubocop/cop/chef/correctness/lazy_in_resource_guard.rb +2 -2
  27. data/lib/rubocop/cop/chef/correctness/macos_userdefaults_invalid_type.rb +2 -2
  28. data/lib/rubocop/cop/chef/correctness/malformed_value_for_platform.rb +2 -2
  29. data/lib/rubocop/cop/chef/correctness/metadata_malformed_version.rb +2 -2
  30. data/lib/rubocop/cop/chef/correctness/metadata_missing_name.rb +1 -1
  31. data/lib/rubocop/cop/chef/correctness/metadata_missing_version.rb +1 -1
  32. data/lib/rubocop/cop/chef/correctness/node_normal.rb +2 -2
  33. data/lib/rubocop/cop/chef/correctness/node_normal_unless.rb +2 -2
  34. data/lib/rubocop/cop/chef/correctness/node_save.rb +1 -1
  35. data/lib/rubocop/cop/chef/correctness/notifies_action_not_symbol.rb +2 -2
  36. data/lib/rubocop/cop/chef/correctness/octal_mode_as_string.rb +2 -2
  37. data/lib/rubocop/cop/chef/correctness/openssl_password_helpers.rb +1 -1
  38. data/lib/rubocop/cop/chef/correctness/powershell_delete_file.rb +2 -2
  39. data/lib/rubocop/cop/chef/correctness/powershell_file_exists.rb +2 -2
  40. data/lib/rubocop/cop/chef/correctness/property_without_type.rb +2 -2
  41. data/lib/rubocop/cop/chef/correctness/resource_sets_internal_properties.rb +2 -2
  42. data/lib/rubocop/cop/chef/correctness/resource_sets_name_property.rb +2 -2
  43. data/lib/rubocop/cop/chef/correctness/resource_with_none_action.rb +2 -2
  44. data/lib/rubocop/cop/chef/correctness/scoped_file_exist.rb +2 -2
  45. data/lib/rubocop/cop/chef/correctness/service_resource.rb +1 -1
  46. data/lib/rubocop/cop/chef/correctness/supports_must_be_float.rb +2 -2
  47. data/lib/rubocop/cop/chef/correctness/tmp_path.rb +2 -2
  48. data/lib/rubocop/cop/chef/deprecation/cb_depends_on_self.rb +2 -2
  49. data/lib/rubocop/cop/chef/deprecation/chef_handler_recipe.rb +1 -1
  50. data/lib/rubocop/cop/chef/deprecation/chef_handler_supports.rb +2 -2
  51. data/lib/rubocop/cop/chef/deprecation/chef_rest.rb +1 -1
  52. data/lib/rubocop/cop/chef/deprecation/chef_shellout.rb +2 -2
  53. data/lib/rubocop/cop/chef/deprecation/chef_sugar_helpers.rb +1 -1
  54. data/lib/rubocop/cop/chef/deprecation/chef_windows_platform_helper.rb +2 -2
  55. data/lib/rubocop/cop/chef/deprecation/chefdk_generators.rb +2 -2
  56. data/lib/rubocop/cop/chef/deprecation/chefspec_coverage_report.rb +1 -1
  57. data/lib/rubocop/cop/chef/deprecation/chefspec_legacy_runner.rb +2 -2
  58. data/lib/rubocop/cop/chef/deprecation/chocolatey_package_uninstall_action.rb +2 -2
  59. data/lib/rubocop/cop/chef/deprecation/depends_chef_nginx_cookbook.rb +2 -2
  60. data/lib/rubocop/cop/chef/deprecation/depends_chef_reporting_cookbook.rb +1 -1
  61. data/lib/rubocop/cop/chef/deprecation/depends_compat_resource.rb +1 -1
  62. data/lib/rubocop/cop/chef/deprecation/depends_omnibus_updater_cookbook.rb +2 -2
  63. data/lib/rubocop/cop/chef/deprecation/depends_partial_search.rb +1 -1
  64. data/lib/rubocop/cop/chef/deprecation/depends_poise.rb +1 -1
  65. data/lib/rubocop/cop/chef/deprecation/deprecated_mixins.rb +1 -1
  66. data/lib/rubocop/cop/chef/deprecation/deprecated_platform_methods.rb +2 -2
  67. data/lib/rubocop/cop/chef/deprecation/deprecated_shellout_methods.rb +2 -2
  68. data/lib/rubocop/cop/chef/deprecation/deprecated_sudo_actions.rb +2 -2
  69. data/lib/rubocop/cop/chef/deprecation/deprecated_windows_version_check.rb +1 -1
  70. data/lib/rubocop/cop/chef/deprecation/deprecated_yum_repository_actions.rb +2 -2
  71. data/lib/rubocop/cop/chef/deprecation/deprecated_yum_repository_properties.rb +2 -2
  72. data/lib/rubocop/cop/chef/deprecation/easy_install.rb +1 -1
  73. data/lib/rubocop/cop/chef/deprecation/eol_audit_mode.rb +1 -1
  74. data/lib/rubocop/cop/chef/deprecation/epic_fail.rb +2 -2
  75. data/lib/rubocop/cop/chef/deprecation/erl_call.rb +1 -1
  76. data/lib/rubocop/cop/chef/deprecation/execute_path_property.rb +2 -2
  77. data/lib/rubocop/cop/chef/deprecation/execute_relative_creates_without_cwd.rb +2 -2
  78. data/lib/rubocop/cop/chef/deprecation/foodcritic_testing.rb +1 -1
  79. data/lib/rubocop/cop/chef/deprecation/hwrp_without_provides.rb +4 -4
  80. data/lib/rubocop/cop/chef/deprecation/hwrp_without_unified_mode_true.rb +2 -2
  81. data/lib/rubocop/cop/chef/deprecation/inherits_compat_resource.rb +2 -2
  82. data/lib/rubocop/cop/chef/deprecation/launchd_deprecated_hash_property.rb +2 -2
  83. data/lib/rubocop/cop/chef/deprecation/legacy_notify_syntax.rb +2 -2
  84. data/lib/rubocop/cop/chef/deprecation/legacy_yum_cookbook_recipes.rb +1 -1
  85. data/lib/rubocop/cop/chef/deprecation/librarian_chefspec.rb +1 -1
  86. data/lib/rubocop/cop/chef/deprecation/locale_lc_all_property.rb +1 -1
  87. data/lib/rubocop/cop/chef/deprecation/log_resource_notifications.rb +2 -2
  88. data/lib/rubocop/cop/chef/deprecation/macos_userdefaults_global_property.rb +2 -2
  89. data/lib/rubocop/cop/chef/deprecation/name_property_and_default.rb +2 -2
  90. data/lib/rubocop/cop/chef/deprecation/node_deep_fetch.rb +4 -4
  91. data/lib/rubocop/cop/chef/deprecation/node_methods_not_attributes.rb +2 -2
  92. data/lib/rubocop/cop/chef/deprecation/node_set.rb +2 -2
  93. data/lib/rubocop/cop/chef/deprecation/node_set_unless.rb +2 -2
  94. data/lib/rubocop/cop/chef/deprecation/node_set_without_level.rb +2 -2
  95. data/lib/rubocop/cop/chef/deprecation/partial_search_class_usage.rb +2 -2
  96. data/lib/rubocop/cop/chef/deprecation/partial_search_helper_usage.rb +2 -2
  97. data/lib/rubocop/cop/chef/deprecation/poise_archive.rb +2 -2
  98. data/lib/rubocop/cop/chef/deprecation/policyfile_community_source.rb +2 -2
  99. data/lib/rubocop/cop/chef/deprecation/powershell_cookbook_helpers.rb +2 -2
  100. data/lib/rubocop/cop/chef/deprecation/require_recipe.rb +2 -2
  101. data/lib/rubocop/cop/chef/deprecation/resource_overrides_provides_method.rb +2 -2
  102. data/lib/rubocop/cop/chef/deprecation/resource_uses_dsl_name_method.rb +2 -2
  103. data/lib/rubocop/cop/chef/deprecation/resource_uses_only_resource_name.rb +1 -1
  104. data/lib/rubocop/cop/chef/deprecation/resource_uses_provider_base_method.rb +1 -1
  105. data/lib/rubocop/cop/chef/deprecation/resource_uses_updated_method.rb +2 -2
  106. data/lib/rubocop/cop/chef/deprecation/resource_without_unified_mode_true.rb +2 -2
  107. data/lib/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings.rb +2 -2
  108. data/lib/rubocop/cop/chef/deprecation/ruby_block_create_action.rb +2 -2
  109. data/lib/rubocop/cop/chef/deprecation/run_command_helper.rb +2 -2
  110. data/lib/rubocop/cop/chef/deprecation/search_uses_positional_parameters.rb +2 -2
  111. data/lib/rubocop/cop/chef/deprecation/use_automatic_resource_name.rb +1 -1
  112. data/lib/rubocop/cop/chef/deprecation/use_inline_resources.rb +1 -1
  113. data/lib/rubocop/cop/chef/deprecation/use_yaml_dump.rb +2 -2
  114. data/lib/rubocop/cop/chef/deprecation/user_supports_property.rb +2 -2
  115. data/lib/rubocop/cop/chef/deprecation/verify_property_file_expansion.rb +2 -2
  116. data/lib/rubocop/cop/chef/deprecation/windows_feature_servermanagercmd.rb +2 -2
  117. data/lib/rubocop/cop/chef/deprecation/windows_package_installer_type_string.rb +2 -2
  118. data/lib/rubocop/cop/chef/deprecation/windows_task_change_action.rb +2 -2
  119. data/lib/rubocop/cop/chef/deprecation/windows_version_helpers.rb +2 -2
  120. data/lib/rubocop/cop/chef/deprecation/xml_ruby_recipe.rb +1 -1
  121. data/lib/rubocop/cop/chef/deprecation/yum_dnf_compat_recipe.rb +1 -1
  122. data/lib/rubocop/cop/chef/effortless/chef_vault_used.rb +6 -6
  123. data/lib/rubocop/cop/chef/effortless/data_bags.rb +1 -1
  124. data/lib/rubocop/cop/chef/effortless/depends_chef_vault.rb +1 -1
  125. data/lib/rubocop/cop/chef/effortless/node_environment.rb +1 -1
  126. data/lib/rubocop/cop/chef/effortless/node_policygroup.rb +1 -1
  127. data/lib/rubocop/cop/chef/effortless/node_roles.rb +1 -1
  128. data/lib/rubocop/cop/chef/effortless/search_for_environments_or_roles.rb +1 -1
  129. data/lib/rubocop/cop/chef/effortless/search_used.rb +1 -1
  130. data/lib/rubocop/cop/chef/modernize/action_method_in_resource.rb +2 -2
  131. data/lib/rubocop/cop/chef/modernize/allowed_actions_initializer.rb +2 -2
  132. data/lib/rubocop/cop/chef/modernize/apt_default_recipe.rb +2 -2
  133. data/lib/rubocop/cop/chef/modernize/berksfile_source.rb +2 -2
  134. data/lib/rubocop/cop/chef/modernize/build_essential.rb +2 -2
  135. data/lib/rubocop/cop/chef/modernize/chef_14_resources.rb +1 -1
  136. data/lib/rubocop/cop/chef/modernize/chef_15_resources.rb +1 -1
  137. data/lib/rubocop/cop/chef/modernize/chef_gem_nokogiri.rb +1 -1
  138. data/lib/rubocop/cop/chef/modernize/class_eval_action_class.rb +2 -2
  139. data/lib/rubocop/cop/chef/modernize/compile_time_resources.rb +2 -2
  140. data/lib/rubocop/cop/chef/modernize/conditional_using_test.rb +2 -2
  141. data/lib/rubocop/cop/chef/modernize/cron_d_file_or_template.rb +2 -2
  142. data/lib/rubocop/cop/chef/modernize/cron_manage_resource.rb +2 -2
  143. data/lib/rubocop/cop/chef/modernize/databag_helpers.rb +2 -2
  144. data/lib/rubocop/cop/chef/modernize/declare_action_class.rb +2 -2
  145. data/lib/rubocop/cop/chef/modernize/default_action_initializer.rb +3 -3
  146. data/lib/rubocop/cop/chef/modernize/defines_chefspec_matchers.rb +1 -1
  147. data/lib/rubocop/cop/chef/modernize/depends_chef_vault_cookbook.rb +1 -1
  148. data/lib/rubocop/cop/chef/modernize/depends_chocolatey_cookbooks.rb +1 -1
  149. data/lib/rubocop/cop/chef/modernize/depends_kernel_module_cookbook.rb +1 -1
  150. data/lib/rubocop/cop/chef/modernize/depends_locale_cookbook.rb +1 -1
  151. data/lib/rubocop/cop/chef/modernize/depends_openssl_cookbook.rb +1 -1
  152. data/lib/rubocop/cop/chef/modernize/depends_timezone_lwrp_cookbook.rb +1 -1
  153. data/lib/rubocop/cop/chef/modernize/depends_windows_firewall_cookbook.rb +1 -1
  154. data/lib/rubocop/cop/chef/modernize/depends_zypper_cookbook.rb +1 -1
  155. data/lib/rubocop/cop/chef/modernize/dsl_include_in_resource.rb +1 -1
  156. data/lib/rubocop/cop/chef/modernize/empty_resource_initialize.rb +1 -1
  157. data/lib/rubocop/cop/chef/modernize/execute_apt_update.rb +2 -2
  158. data/lib/rubocop/cop/chef/modernize/execute_sc_exe.rb +2 -2
  159. data/lib/rubocop/cop/chef/modernize/execute_sleep.rb +2 -2
  160. data/lib/rubocop/cop/chef/modernize/execute_sysctl.rb +2 -2
  161. data/lib/rubocop/cop/chef/modernize/execute_tzutil.rb +2 -2
  162. data/lib/rubocop/cop/chef/modernize/foodcritic_comments.rb +1 -1
  163. data/lib/rubocop/cop/chef/modernize/if_provides_default_action.rb +2 -2
  164. data/lib/rubocop/cop/chef/modernize/includes_mixin_shellout.rb +1 -1
  165. data/lib/rubocop/cop/chef/modernize/libarchive_file.rb +2 -2
  166. data/lib/rubocop/cop/chef/modernize/macos_user_defaults.rb +2 -2
  167. data/lib/rubocop/cop/chef/modernize/minitest_handler_usage.rb +1 -1
  168. data/lib/rubocop/cop/chef/modernize/node_init_package.rb +2 -2
  169. data/lib/rubocop/cop/chef/modernize/node_roles_include.rb +2 -2
  170. data/lib/rubocop/cop/chef/modernize/ohai_default_recipe.rb +1 -1
  171. data/lib/rubocop/cop/chef/modernize/openssl_rsa_key_resource.rb +2 -2
  172. data/lib/rubocop/cop/chef/modernize/openssl_x509_resource.rb +2 -2
  173. data/lib/rubocop/cop/chef/modernize/osx_config_profile_resource.rb +2 -2
  174. data/lib/rubocop/cop/chef/modernize/powershell_expand_archive.rb +1 -1
  175. data/lib/rubocop/cop/chef/modernize/powershell_guard_interpreter.rb +2 -2
  176. data/lib/rubocop/cop/chef/modernize/powershell_install_package.rb +2 -2
  177. data/lib/rubocop/cop/chef/modernize/powershell_install_windowsfeature.rb +2 -2
  178. data/lib/rubocop/cop/chef/modernize/property_with_name_attribute.rb +2 -2
  179. data/lib/rubocop/cop/chef/modernize/provides_initializer.rb +2 -2
  180. data/lib/rubocop/cop/chef/modernize/resource_name_initializer.rb +2 -2
  181. data/lib/rubocop/cop/chef/modernize/resource_set_or_return.rb +2 -2
  182. data/lib/rubocop/cop/chef/modernize/resource_with_attributes.rb +2 -2
  183. data/lib/rubocop/cop/chef/modernize/respond_to_compile_time.rb +2 -2
  184. data/lib/rubocop/cop/chef/modernize/respond_to_metadata.rb +2 -2
  185. data/lib/rubocop/cop/chef/modernize/respond_to_provides.rb +2 -2
  186. data/lib/rubocop/cop/chef/modernize/respond_to_resource_name.rb +2 -2
  187. data/lib/rubocop/cop/chef/modernize/sc_windows_resource.rb +2 -2
  188. data/lib/rubocop/cop/chef/modernize/seven_zip_archive.rb +1 -1
  189. data/lib/rubocop/cop/chef/modernize/shell_out_helper.rb +2 -2
  190. data/lib/rubocop/cop/chef/modernize/shellouts_to_chocolatey.rb +1 -1
  191. data/lib/rubocop/cop/chef/modernize/simplify_apt_ppa_setup.rb +2 -2
  192. data/lib/rubocop/cop/chef/modernize/sysctl_param_resource.rb +2 -2
  193. data/lib/rubocop/cop/chef/modernize/unnecessary_mixlib_shellout_require.rb +1 -1
  194. data/lib/rubocop/cop/chef/modernize/use_chef_language_cloud_helpers.rb +2 -2
  195. data/lib/rubocop/cop/chef/modernize/use_chef_language_env_helpers.rb +2 -2
  196. data/lib/rubocop/cop/chef/modernize/use_chef_language_systemd_helper.rb +2 -2
  197. data/lib/rubocop/cop/chef/modernize/use_multipackage_installs.rb +2 -2
  198. data/lib/rubocop/cop/chef/modernize/use_require_relative.rb +2 -2
  199. data/lib/rubocop/cop/chef/modernize/whyrun_supported_true.rb +1 -1
  200. data/lib/rubocop/cop/chef/modernize/windows_default_recipe.rb +1 -1
  201. data/lib/rubocop/cop/chef/modernize/windows_registry_uac.rb +2 -2
  202. data/lib/rubocop/cop/chef/modernize/windows_zipfile.rb +1 -1
  203. data/lib/rubocop/cop/chef/modernize/zipfile_resource.rb +1 -1
  204. data/lib/rubocop/cop/chef/modernize/zypper_repo.rb +2 -2
  205. data/lib/rubocop/cop/chef/redundant/apt_repository_distribution_default.rb +2 -2
  206. data/lib/rubocop/cop/chef/redundant/apt_repository_notifies_apt_update.rb +2 -2
  207. data/lib/rubocop/cop/chef/redundant/attribute_metadata.rb +1 -1
  208. data/lib/rubocop/cop/chef/redundant/conflicts_metadata.rb +1 -1
  209. data/lib/rubocop/cop/chef/redundant/custom_resource_with_allowed_actions.rb +1 -1
  210. data/lib/rubocop/cop/chef/redundant/double_compile_time.rb +2 -2
  211. data/lib/rubocop/cop/chef/redundant/grouping_metadata.rb +1 -1
  212. data/lib/rubocop/cop/chef/redundant/long_description_metadata.rb +1 -1
  213. data/lib/rubocop/cop/chef/redundant/multiple_platform_checks.rb +2 -2
  214. data/lib/rubocop/cop/chef/redundant/name_property_and_required.rb +2 -2
  215. data/lib/rubocop/cop/chef/redundant/ohai_attribute_to_string.rb +2 -2
  216. data/lib/rubocop/cop/chef/redundant/property_splat_regex.rb +2 -2
  217. data/lib/rubocop/cop/chef/redundant/property_with_default_and_required.rb +2 -2
  218. data/lib/rubocop/cop/chef/redundant/provides_metadata.rb +1 -1
  219. data/lib/rubocop/cop/chef/redundant/recipe_metadata.rb +1 -1
  220. data/lib/rubocop/cop/chef/redundant/replaces_metadata.rb +1 -1
  221. data/lib/rubocop/cop/chef/redundant/resource_with_nothing_action.rb +1 -1
  222. data/lib/rubocop/cop/chef/redundant/sensitive_property_in_resource.rb +1 -1
  223. data/lib/rubocop/cop/chef/redundant/string_property_with_nil_default.rb +2 -2
  224. data/lib/rubocop/cop/chef/redundant/suggests_metadata.rb +1 -1
  225. data/lib/rubocop/cop/chef/redundant/unnecessary_desired_state.rb +2 -2
  226. data/lib/rubocop/cop/chef/redundant/unnecessary_name_property.rb +1 -1
  227. data/lib/rubocop/cop/chef/redundant/use_create_if_missing.rb +2 -2
  228. data/lib/rubocop/cop/chef/security/ssh_private_key.rb +1 -1
  229. data/lib/rubocop/cop/chef/sharing/default_maintainer_metadata.rb +2 -2
  230. data/lib/rubocop/cop/chef/sharing/empty_metadata_field.rb +2 -2
  231. data/lib/rubocop/cop/chef/sharing/include_property_descriptions.rb +2 -2
  232. data/lib/rubocop/cop/chef/sharing/include_resource_descriptions.rb +1 -1
  233. data/lib/rubocop/cop/chef/sharing/include_resource_examples.rb +1 -1
  234. data/lib/rubocop/cop/chef/sharing/insecure_cookbook_url.rb +2 -2
  235. data/lib/rubocop/cop/chef/sharing/invalid_license_string.rb +2 -2
  236. data/lib/rubocop/cop/chef/style/attribute_keys.rb +4 -4
  237. data/lib/rubocop/cop/chef/style/chef_whaaat.rb +2 -2
  238. data/lib/rubocop/cop/chef/style/comment_sentence_spacing.rb +1 -1
  239. data/lib/rubocop/cop/chef/style/comments_copyright_format.rb +2 -2
  240. data/lib/rubocop/cop/chef/style/comments_default_copyright.rb +2 -2
  241. data/lib/rubocop/cop/chef/style/comments_format.rb +2 -2
  242. data/lib/rubocop/cop/chef/style/file_mode.rb +2 -2
  243. data/lib/rubocop/cop/chef/style/immediate_notification_timing.rb +2 -2
  244. data/lib/rubocop/cop/chef/style/include_recipe_with_parentheses.rb +2 -2
  245. data/lib/rubocop/cop/chef/style/negating_only_if.rb +2 -2
  246. data/lib/rubocop/cop/chef/style/overly_complex_supports_depends_metadata.rb +2 -2
  247. data/lib/rubocop/cop/chef/style/simplify_platform_major_version_check.rb +2 -2
  248. data/lib/rubocop/cop/chef/style/true_false_resource_properties.rb +2 -2
  249. data/lib/rubocop/cop/chef/style/unnecessary_os_check.rb +2 -2
  250. data/lib/rubocop/cop/chef/style/unnecessary_platform_case_statement.rb +2 -2
  251. data/lib/rubocop/cop/chef/style/use_platform_helpers.rb +2 -2
  252. data/lib/rubocop/cop/chefstyle/ruby/gemspec_license.rb +55 -0
  253. data/lib/rubocop/cop/chefstyle/ruby/gemspec_require_rubygems.rb +46 -0
  254. data/lib/rubocop/cop/chefstyle/ruby/legacy_powershell_out_methods.rb +36 -0
  255. data/lib/rubocop/cop/chefstyle/ruby/require_net_https.rb +54 -0
  256. data/lib/rubocop/cop/chefstyle/ruby/unless_defined_require.rb +122 -0
  257. data/lib/rubocop/cop/inspec/deprecation/attribute_default.rb +2 -2
  258. data/lib/rubocop/cop/inspec/deprecation/attribute_helper.rb +2 -2
  259. metadata +8 -4
  260. data/config/disable_all.yml +0 -987
  261. data/config/upstream.yml +0 -5132
@@ -0,0 +1,741 @@
1
+ # This is an internal RuboCop configuration for Chef Ruby projects (chef-client, ohai,
2
+ # mixlib-shellout, mixlib-config, etc).
3
+ #
4
+ # It is not meant for consumption by cookbooks or for any general purpose uses.
5
+ # **Chef Users and Customers Should Generally Not Use This Configuration and
6
+ # Should Use cookstyle.yml**. It is not intended for any audience outside of
7
+ # Chef Core Ruby development.
8
+
9
+ AllCops:
10
+ TargetRubyVersion: 2.5
11
+ NewCops: disable
12
+ DisabledByDefault: true
13
+ SuggestExtensions: false
14
+
15
+ #
16
+ # Bundler
17
+ #
18
+
19
+ Bundler/DuplicatedGem:
20
+ Enabled: false
21
+
22
+ Bundler/InsecureProtocolSource:
23
+ Enabled: true
24
+ AllowHttpProtocol: false
25
+
26
+ #
27
+ # Lint
28
+ #
29
+
30
+ Lint/AmbiguousOperator:
31
+ Enabled: true
32
+ Lint/AmbiguousBlockAssociation:
33
+ Enabled: true
34
+ Lint/AmbiguousRegexpLiteral:
35
+ Enabled: true
36
+ Lint/AssignmentInCondition:
37
+ Enabled: true
38
+ Layout/BlockAlignment:
39
+ EnforcedStyleAlignWith: start_of_block
40
+ Enabled: true
41
+ Lint/CircularArgumentReference:
42
+ Enabled: true
43
+ Layout/ConditionPosition:
44
+ Enabled: true
45
+ Lint/Debugger:
46
+ Enabled: true
47
+ Layout/DefEndAlignment:
48
+ Enabled: true
49
+ AutoCorrect: true
50
+ Lint/DeprecatedClassMethods:
51
+ Enabled: true
52
+ Lint/DuplicateCaseCondition:
53
+ Enabled: true
54
+ Lint/DuplicateMethods:
55
+ Enabled: true
56
+ # Lint/DuplicatedKey: TODO broken with rubocop 1.25.1 move
57
+ # Enabled: true
58
+ Lint/EachWithObjectArgument:
59
+ Enabled: true
60
+ Lint/ElseLayout:
61
+ Enabled: true
62
+ Lint/EmptyEnsure:
63
+ Enabled: true
64
+ Lint/EmptyExpression:
65
+ Enabled: true
66
+ Lint/EmptyInterpolation:
67
+ Enabled: true
68
+ Lint/EmptyWhen:
69
+ Enabled: true
70
+ Layout/EndAlignment:
71
+ Enabled: true
72
+ AutoCorrect: true
73
+ # Lint/EndInMethod: TODO broken with rubocop 1.25.1 move
74
+ # Enabled: true
75
+ Lint/EnsureReturn:
76
+ Enabled: true
77
+ Lint/FloatOutOfRange:
78
+ Enabled: true
79
+ Lint/FormatParameterMismatch:
80
+ Enabled: true
81
+ Lint/ImplicitStringConcatenation:
82
+ Enabled: true
83
+ Lint/InheritException:
84
+ Enabled: true
85
+ Lint/IneffectiveAccessModifier:
86
+ Enabled: true
87
+ Lint/LiteralAsCondition:
88
+ Enabled: true
89
+ Lint/LiteralInInterpolation:
90
+ Enabled: true
91
+ Lint/Loop:
92
+ Enabled: true
93
+ # Lint/MultipleCompare: TODO broken with rubocop 1.25.1 move
94
+ # Enabled: true
95
+ Lint/NestedMethodDefinition:
96
+ Enabled: true
97
+ Lint/NextWithoutAccumulator:
98
+ Enabled: true
99
+ Lint/NonLocalExitFromIterator:
100
+ Enabled: true
101
+ Lint/ParenthesesAsGroupedExpression:
102
+ Enabled: true
103
+ Lint/PercentStringArray:
104
+ Enabled: true
105
+ Lint/PercentSymbolArray:
106
+ Enabled: true
107
+ Lint/RandOne:
108
+ Enabled: true
109
+ Lint/RequireParentheses:
110
+ Enabled: true
111
+ Lint/SafeNavigationChain:
112
+ Enabled: true
113
+ Lint/ShadowedException:
114
+ Enabled: true
115
+ Lint/ShadowingOuterLocalVariable:
116
+ Enabled: true
117
+ # Lint/StringConversionInInterpolation: TODO broken with rubocop 1.25.1 move
118
+ # Enabled: true
119
+ Lint/UnderscorePrefixedVariableName:
120
+ Enabled: true
121
+ Lint/UnifiedInteger:
122
+ Enabled: true
123
+ # Lint/UnneededSplatExpansion: TODO broken with rubocop 1.25.1 move
124
+ # Enabled: true
125
+ Lint/UnreachableCode:
126
+ Enabled: true
127
+ Lint/UriEscapeUnescape:
128
+ Enabled: true
129
+ Lint/UselessAccessModifier:
130
+ Enabled: true
131
+ Lint/UselessAssignment:
132
+ Enabled: true
133
+ # Lint/UselessComparison: TODO broken with rubocop 1.25.1 move
134
+ # Enabled: true
135
+ Lint/UselessElseWithoutRescue:
136
+ Enabled: true
137
+ Lint/UselessSetterCall:
138
+ Enabled: true
139
+ Lint/Void:
140
+ Enabled: true
141
+ Layout/CommentIndentation:
142
+ Enabled: true
143
+
144
+ #
145
+ # Disabled Lint
146
+ #
147
+
148
+ # These are disabled per https://github.com/chef/chef/pull/3038
149
+ Lint/UnusedBlockArgument:
150
+ Enabled: false
151
+ Lint/UnusedMethodArgument:
152
+ Enabled: false
153
+
154
+ # We ignore Exceptions a lot
155
+ Lint/SuppressedException:
156
+ Enabled: false
157
+ # We also decorate Exceptions a lot
158
+ Lint/RescueException:
159
+ Enabled: false
160
+
161
+ # disabling this will make it easier to stage chefstyle rollouts
162
+ Lint/RedundantCopDisableDirective:
163
+ Enabled: false
164
+
165
+ #
166
+ # Security
167
+ #
168
+
169
+ Security/Eval:
170
+ Enabled: true
171
+
172
+ #
173
+ # Metrics
174
+ #
175
+
176
+ # Metrics cops are all disabled, there would be too much refactoring
177
+ # work to do and we have much higher priorities.
178
+ Metrics/AbcSize:
179
+ Enabled: false
180
+ Metrics/BlockNesting:
181
+ Enabled: false
182
+ Metrics/BlockLength:
183
+ Enabled: false
184
+ Metrics/ClassLength:
185
+ Enabled: false
186
+ Metrics/CyclomaticComplexity:
187
+ Enabled: false
188
+ Layout/LineLength:
189
+ Enabled: false
190
+ Metrics/MethodLength:
191
+ Enabled: false
192
+ Metrics/ModuleLength:
193
+ Enabled: false
194
+ Metrics/ParameterLists:
195
+ Enabled: false
196
+ Metrics/PerceivedComplexity:
197
+ Enabled: false
198
+
199
+
200
+ #
201
+ # Style/Naming/Layout
202
+ #
203
+
204
+ Layout/AccessModifierIndentation:
205
+ Enabled: true
206
+ # Layout/AlignArguments: TODO broken with rubocop 1.25.1 move
207
+ # Enabled: true
208
+ # EnforcedStyle: with_fixed_indentation
209
+ # Layout/AlignParameters: TODO broken with rubocop 1.25.1 move
210
+ # Enabled: true
211
+ # EnforcedStyle: with_fixed_indentation
212
+ # the "ignore_implict" is here for keyword args in method calls which are
213
+ # "implicit" hashes, and those should not be treated like normal hashes
214
+ # Layout/AlignHash: TODO broken with rubocop 1.25.1 move
215
+ # Enabled: true
216
+ # EnforcedLastArgumentHashStyle: ignore_implicit
217
+ Style/AndOr:
218
+ Enabled: true
219
+ Style/ArrayJoin:
220
+ Enabled: true
221
+ Naming/AsciiIdentifiers:
222
+ Enabled: true
223
+ Style/Attr:
224
+ Enabled: true
225
+ Style/BeginBlock:
226
+ Enabled: true
227
+ # there's debate over one-liner vs semantic blockstyle, chef projects should just pick one style
228
+ # and stick with it.
229
+ Style/BlockDelimiters:
230
+ Enabled: false
231
+ Layout/BlockEndNewline:
232
+ Enabled: true
233
+ Style/CharacterLiteral:
234
+ Enabled: true
235
+ Style/ClassCheck:
236
+ Enabled: true
237
+ Style/ClassMethods:
238
+ Enabled: true
239
+ Layout/ClosingHeredocIndentation:
240
+ Enabled: true
241
+ Layout/ClosingParenthesisIndentation:
242
+ Enabled: true
243
+ Style/ColonMethodCall:
244
+ Enabled: true
245
+ Style/CommandLiteral:
246
+ Enabled: true
247
+ Naming/ConstantName:
248
+ Enabled: true
249
+ Style/DefWithParentheses:
250
+ Enabled: true
251
+ Layout/DotPosition:
252
+ Enabled: True
253
+ Style/EachForSimpleLoop:
254
+ Enabled: true
255
+ Layout/ElseAlignment:
256
+ Enabled: true
257
+ Layout/EmptyLineAfterGuardClause:
258
+ Enabled: true
259
+ Layout/EmptyLineBetweenDefs:
260
+ Enabled: true
261
+ AllowAdjacentOneLineDefs: true
262
+ Layout/EmptyLines:
263
+ Enabled: true
264
+ Layout/EmptyLinesAroundAccessModifier:
265
+ Enabled: true
266
+ Layout/EmptyLinesAroundMethodBody:
267
+ Enabled: true
268
+ Style/EmptyLiteral:
269
+ Enabled: true
270
+ Style/EmptyMethod:
271
+ Enabled: true
272
+ Style/EndBlock:
273
+ Enabled: true
274
+ Layout/EndOfLine:
275
+ Enabled: true
276
+ EnforcedStyle: lf
277
+ Style/EvenOdd:
278
+ Enabled: true
279
+ Layout/ExtraSpacing:
280
+ Enabled: true
281
+ Lint/FlipFlop:
282
+ Enabled: true
283
+ Style/For:
284
+ Enabled: true
285
+ Style/HashSyntax:
286
+ Enabled: true
287
+ Naming/HeredocDelimiterCase:
288
+ Enabled: true
289
+ Style/IfUnlessModifierOfIfUnless:
290
+ Enabled: true
291
+ Style/IfWithSemicolon:
292
+ Enabled: true
293
+ # Layout/IndentAssignment: TODO broken with rubocop 1.25.1 move
294
+ # Enabled: true
295
+ # Layout/IndentFirstArgument: TODO broken with rubocop 1.25.1 move
296
+ # EnforcedStyle: consistent
297
+ # Enabled: true
298
+ # Layout/IndentHeredoc: TODO broken with rubocop 1.25.1 move
299
+ # Enabled: true
300
+ Layout/IndentationConsistency:
301
+ Enabled: true
302
+ Layout/IndentationWidth:
303
+ Enabled: true
304
+ Style/InfiniteLoop:
305
+ Enabled: true
306
+ Layout/InitialIndentation:
307
+ Enabled: true
308
+ Style/LambdaCall:
309
+ Enabled: true
310
+ Layout/LeadingCommentSpace:
311
+ Enabled: true
312
+ Style/MethodDefParentheses:
313
+ Enabled: true
314
+ Style/MethodCallWithoutArgsParentheses:
315
+ Enabled: true
316
+ Layout/MultilineBlockLayout:
317
+ Enabled: true
318
+ Style/MultilineIfModifier:
319
+ Enabled: true
320
+ Style/MultilineIfThen:
321
+ Enabled: true
322
+ Style/MultilineMemoization:
323
+ Enabled: true
324
+ Layout/MultilineMethodCallBraceLayout:
325
+ Enabled: true
326
+ Layout/MultilineMethodCallIndentation:
327
+ Enabled: true
328
+ EnforcedStyle: indented
329
+ Layout/MultilineMethodDefinitionBraceLayout:
330
+ Enabled: true
331
+ Layout/MultilineOperationIndentation:
332
+ Enabled: true
333
+ EnforcedStyle: indented
334
+ Style/MultilineTernaryOperator:
335
+ Enabled: true
336
+ Style/MutableConstant:
337
+ Enabled: true
338
+ Style/NegatedIf:
339
+ Enabled: true
340
+ Style/NegatedWhile:
341
+ Enabled: true
342
+ Style/NegatedUnless:
343
+ Enabled: true
344
+ Style/NestedModifier:
345
+ Enabled: true
346
+ Style/NestedTernaryOperator:
347
+ Enabled: true
348
+ Style/NilComparison:
349
+ Enabled: true
350
+ Style/NonNilCheck:
351
+ Enabled: true
352
+ # `foo.zero?` is slower and substantially more annoying to read than `foo == 0`
353
+ Style/NumericPredicate:
354
+ Enabled: true
355
+ EnforcedStyle: comparison
356
+ Style/OneLineConditional:
357
+ Enabled: true
358
+ Naming/BinaryOperatorParameterName:
359
+ Enabled: true
360
+ Style/OptionalArguments:
361
+ Enabled: true
362
+ Style/ParenthesesAroundCondition:
363
+ Enabled: true
364
+ # - The chef source code predominantly uses {} for %,%i,%q,%Q,%r,%w,%W
365
+ # - The old 1.9 pickaxe book predominantly uses {} for %,%q,%Q,%r,%w,%W,%x
366
+ # - The chef source code does not use %x enough to determine a preference
367
+ # - The old 1.9 pickaxe book does not use %i
368
+ # - %s is not used in chef code or the pickaxe book, and is %s{} for consistency
369
+ Style/PercentLiteralDelimiters:
370
+ Enabled: true
371
+ PreferredDelimiters:
372
+ '%': '{}'
373
+ '%i': '{}'
374
+ '%I': '{}'
375
+ '%q': '{}'
376
+ '%Q': '{}'
377
+ '%r': '{}'
378
+ '%s': '{}'
379
+ '%w': '{}'
380
+ '%W': '{}'
381
+ '%x': '{}'
382
+ Style/PercentQLiterals:
383
+ Enabled: true
384
+ Style/PreferredHashMethods:
385
+ Enabled: true
386
+ Style/RedundantBegin:
387
+ Enabled: true
388
+ Style/RedundantException:
389
+ Enabled: true
390
+ Style/RedundantFreeze:
391
+ Enabled: true
392
+ Style/RedundantReturn:
393
+ Enabled: true
394
+ Style/RedundantSelf:
395
+ Enabled: true
396
+ Layout/RescueEnsureAlignment:
397
+ Enabled: true
398
+ Style/RegexpLiteral:
399
+ Enabled: true
400
+ # temporarily disabled, but we should do this
401
+ Style/SafeNavigation:
402
+ Enabled: false
403
+ Style/SelfAssignment:
404
+ Enabled: true
405
+ Style/Semicolon:
406
+ AllowAsExpressionSeparator: true
407
+ Enabled: true
408
+ # we only 'raise' and do not 'fail'
409
+ Style/SignalException:
410
+ EnforcedStyle: only_raise
411
+ Enabled: true
412
+ Layout/SpaceAfterColon:
413
+ Enabled: true
414
+ Layout/SpaceAfterComma:
415
+ Enabled: true
416
+ Layout/SpaceAfterMethodName:
417
+ Enabled: true
418
+ Layout/SpaceAfterSemicolon:
419
+ Enabled: true
420
+ Layout/SpaceAroundBlockParameters:
421
+ Enabled: true
422
+ Layout/SpaceAroundEqualsInParameterDefault:
423
+ Enabled: true
424
+ Layout/SpaceAroundOperators:
425
+ Enabled: true
426
+ Layout/SpaceBeforeBlockBraces:
427
+ Enabled: true
428
+ Layout/SpaceBeforeComment:
429
+ Enabled: true
430
+ Layout/SpaceBeforeSemicolon:
431
+ Enabled: true
432
+ Layout/SpaceAroundKeyword:
433
+ Enabled: true
434
+ Layout/SpaceInLambdaLiteral:
435
+ Enabled: true
436
+ Layout/SpaceInsideArrayPercentLiteral:
437
+ Enabled: true
438
+ Layout/SpaceInsideBlockBraces:
439
+ Enabled: true
440
+ Layout/SpaceInsideHashLiteralBraces:
441
+ Enabled: true
442
+ Layout/SpaceInsideRangeLiteral:
443
+ Enabled: true
444
+ Layout/SpaceInsideStringInterpolation:
445
+ Enabled: true
446
+ Style/StabbyLambdaParentheses:
447
+ Enabled: true
448
+ # core chef community prefers double quotes over single quotes
449
+ Style/StringLiterals:
450
+ EnforcedStyle: double_quotes
451
+ Enabled: true
452
+ Style/StringLiteralsInInterpolation:
453
+ EnforcedStyle: double_quotes
454
+ Enabled: true
455
+ Style/StructInheritance:
456
+ Enabled: true
457
+ Style/SymbolLiteral:
458
+ Enabled: true
459
+ Style/StringMethods:
460
+ Enabled: true
461
+ Style/SymbolArray:
462
+ Enabled: true
463
+ Style/SymbolProc:
464
+ Enabled: true
465
+ Layout/IndentationStyle:
466
+ Enabled: true
467
+ # Layout/TrailingBlankLines: TODO broken with rubocop 1.25.1 move
468
+ # Enabled: true
469
+ Style/TrailingCommaInArguments:
470
+ Enabled: true
471
+ # rubocop's default gets this completely backwards
472
+ Style/TrailingCommaInArrayLiteral:
473
+ Enabled: true
474
+ EnforcedStyleForMultiline: comma
475
+ Style/TrailingCommaInHashLiteral:
476
+ Enabled: true
477
+ EnforcedStyleForMultiline: comma
478
+ Style/TrailingUnderscoreVariable:
479
+ Enabled: true
480
+ Layout/TrailingWhitespace:
481
+ Enabled: true
482
+ # Style/UnneededCapitalW: TODO broken with rubocop 1.25.1 move
483
+ # Enabled: true
484
+ Style/RedundantInterpolation:
485
+ Enabled: false # buggy: https://github.com/rubocop-hq/rubocop/issues/6099
486
+ #Style/UnneededPercentQ: # would like to enable this one but its buggy as of 0.35.1
487
+ # Enabled: true
488
+ Naming/VariableName:
489
+ Enabled: true
490
+ Style/VariableInterpolation:
491
+ Enabled: true
492
+ Style/WhenThen:
493
+ Enabled: true
494
+ Style/WhileUntilDo:
495
+ Enabled: true
496
+ Style/WhileUntilModifier:
497
+ Enabled: true
498
+ Style/WordArray:
499
+ Enabled: true
500
+
501
+ # we are ruby > 2.0 only so we can remove encoding comments for utf-8
502
+ Style/Encoding:
503
+ Enabled: true
504
+
505
+ #
506
+ # Disabled Style
507
+ #
508
+
509
+ # reduces memory usage, but isn't a simple autocorrect so we need to do this one project at a time
510
+ Style/FrozenStringLiteralComment:
511
+ Enabled: false
512
+
513
+ # As of this commit we have 686 modules and classes without docs.
514
+ # This is a cop that we /should/ have enabled, but tactically we can't really enable.
515
+ Style/Documentation:
516
+ Enabled: false
517
+ Style/DocumentationMethod:
518
+ Enabled: false
519
+
520
+ # this makes whitespace formatting of DSL code impossible
521
+ Layout/SpaceBeforeFirstArg:
522
+ Enabled: false
523
+
524
+ # whitespace in expressions is useful to enhance readability
525
+ Layout/SpaceInsideArrayLiteralBrackets:
526
+ Enabled: false
527
+ Layout/SpaceInsideReferenceBrackets:
528
+ Enabled: false
529
+ Layout/SpaceInsideParens:
530
+ Enabled: false
531
+ Layout/SpaceInsidePercentLiteralDelimiters:
532
+ Enabled: false
533
+
534
+ # more whitespace cops that we allow since they can enhance readability
535
+ Layout/EmptyLinesAroundBlockBody:
536
+ Enabled: false
537
+ Layout/EmptyLinesAroundClassBody:
538
+ Enabled: false
539
+ Layout/EmptyLinesAroundModuleBody:
540
+ Enabled: false
541
+
542
+ # double negation is perfectly idiomatic ruby
543
+ Style/DoubleNegation:
544
+ Enabled: false
545
+ # format strings are also perfectly idiomatic ruby
546
+ Style/FormatString:
547
+ Enabled: false
548
+ # single line if/unless blocks may read more naturally than modifiers
549
+ Style/IfUnlessModifier:
550
+ Enabled: false
551
+
552
+ # Dan is -1 on this one: https://github.com/chef/chef/pull/4526#issuecomment-179950045
553
+ Layout/FirstHashElementIndentation:
554
+ Enabled: false
555
+
556
+ # This is overly aggressive and autofix broke stuff, would need to exclude classes
557
+ # - https://github.com/chef/chef/pull/4541
558
+ Style/TrivialAccessors:
559
+ Enabled: false
560
+
561
+ # Not a lot of offenses and this seems to catch code that looks otherwise fine to my eye
562
+ Style/MultilineBlockChain:
563
+ Enabled: false
564
+
565
+ # We see nothing at all wrong with a trailing `rescue nil`
566
+ Style/RescueModifier:
567
+ Enabled: false
568
+
569
+ # Resulted in a bit of a bikeshed over names with unicode chars vs silently hidden unicode chars in comments
570
+ Style/AsciiComments:
571
+ Enabled: false
572
+
573
+ # Parens around ternaries often make them more readable and reduces cognitive load over operator precedence
574
+ Style/TernaryParentheses:
575
+ Enabled: false
576
+
577
+ # Underscores in numbers are super ugly for port numbers, freebsd versions, etc.
578
+ # If we could mandate that this gets turned on only for numbers >= 1e9 which require three _'s then maybe.
579
+ Style/NumericLiterals:
580
+ Enabled: false
581
+
582
+ # I tend to find this more readable than long elsif chains
583
+ Style/EmptyCaseCondition:
584
+ Enabled: false
585
+
586
+ # This didn't quite do what we need
587
+ Layout/MultilineArrayBraceLayout:
588
+ Enabled: false
589
+
590
+ # This rule isn't smart enough to figure out accessors vs. things that set stuff on the system (e.g. set_member method in group providers)
591
+ Naming/AccessorMethodName:
592
+ Enabled: false
593
+
594
+ # Perl backrefs are just fine and the alternative is a lot of typing.
595
+ Style/PerlBackrefs:
596
+ Enabled: false
597
+
598
+ # This has an annoying auto-fix which fails to `require "english"` and then fails silently
599
+ Style/SpecialGlobalVars:
600
+ Enabled: false
601
+
602
+ # This cop is horrible and I hate the code it produces (even though I tend to like GuardClauses in lots of cases)
603
+ Style/GuardClause:
604
+ Enabled: false
605
+
606
+ Style/RedundantSortBy:
607
+ Enabled: true
608
+
609
+ Style/Sample:
610
+ Enabled: true
611
+
612
+ # Let authors order gems however makes sense
613
+ Bundler/OrderedGems:
614
+ Enabled: false
615
+
616
+ # Naming cops produce fairly pointless makework (e.g. EOF on HEREDOC's is
617
+ # perfectly fine and understandable, using 'ip' as a parameter to a function
618
+ # is also perfectly descriptive even though its only 2 characters...).
619
+ Naming/HeredocDelimiterNaming:
620
+ Enabled: false
621
+ Naming/PredicateName:
622
+ Enabled: false
623
+ Naming/MethodParameterName:
624
+ Enabled: false
625
+ Naming/MemoizedInstanceVariableName:
626
+ Enabled: false
627
+ Naming/VariableNumber:
628
+ Enabled: false
629
+
630
+ # We almost never use format strings but this cop triggers on any string with "%{whatever}" in it and is 99% false positives
631
+ Style/FormatStringToken:
632
+ Enabled: false
633
+
634
+ # This cop is annoying. The rubocop default of course goes against the most popular community guidelines due to contrariness
635
+ # and then the autocorrect mangles specs in chef/chef. Burned more time than it was worth looking at this one so its off.
636
+ Style/Alias:
637
+ Enabled: false
638
+
639
+ # No autofix for this one, and I don't care to fix 138 instances of it in the chef/chef codebase. Don't think its worth wasting
640
+ # anyone else's time either.
641
+ Style/CommentedKeyword:
642
+ Enabled: false
643
+
644
+ # make sure we catch this Ruby 3.0 breaking change now
645
+ Lint/DeprecatedOpenSSLConstant:
646
+ Enabled: true
647
+
648
+ # alert on invalid ruby synatx
649
+ Lint/Syntax:
650
+ Enabled: true
651
+
652
+ # remove extra requires like 'thread'
653
+ Lint/RedundantRequireStatement:
654
+ Enabled: true
655
+
656
+ # simplify stripping strings
657
+ Style/Strip:
658
+ Enabled: true
659
+
660
+ # simplify getting min/max
661
+ Style/RedundantSort:
662
+ Enabled: true
663
+
664
+ # no need for .rb in requires
665
+ Style/RedundantFileExtensionInRequire:
666
+ Enabled: true
667
+
668
+ # more code you don't need
669
+ Style/RedundantCondition:
670
+ Enabled: true
671
+
672
+ # Use __dir__ to simplify things
673
+ Style/Dir:
674
+ Enabled: true
675
+
676
+ # Use __FILE__ or __dir__ to simplify expand_paths
677
+ Style/ExpandPathArguments:
678
+ Enabled: true
679
+
680
+ # more code you don't need
681
+ Lint/RedundantSafeNavigation:
682
+ Enabled: true
683
+
684
+ # Eases readability
685
+ Lint/RedundantStringCoercion:
686
+ Enabled: true
687
+
688
+ # unnecessary complexity
689
+ Lint/RedundantWithObject:
690
+ Enabled: true
691
+
692
+ # unnecessary complexity
693
+ Lint/RedundantWithIndex:
694
+ Enabled: true
695
+
696
+ # avoid requiring twice
697
+ Lint/DuplicateRequire:
698
+ Enabled: true
699
+
700
+ # detect assignment typos
701
+ Lint/AmbiguousAssignment:
702
+ Enabled: true
703
+
704
+ Chef/Deprecations/Ruby27KeywordArgumentWarnings:
705
+ Description: Pass options to shell_out helpers without the brackets to avoid Ruby 2.7 deprecation warnings.
706
+ Enabled: true
707
+ VersionAdded: '1.3.0'
708
+
709
+ Chef/Ruby/UnlessDefinedRequire:
710
+ Description: Workaround RubyGems' slow requires by only running require if the constant isn't already defined
711
+ Enabled: true
712
+ VersionAdded: '1.3.0'
713
+ Include:
714
+ - 'lib/**/*'
715
+
716
+ Chef/Ruby/GemspecRequireRubygems:
717
+ Description: Rubygems does not need to be required in a Gemspec
718
+ Enabled: true
719
+ VersionAdded: '1.3.0'
720
+ Include:
721
+ - '**/*.gemspec'
722
+
723
+ Chef/Ruby/GemspecLicense:
724
+ Description: 'All gemspec files should define their license.'
725
+ Enabled: true
726
+ VersionAdded: '1.7.0'
727
+ Include:
728
+ - '**/*.gemspec'
729
+ Exclude:
730
+ - '/**/spec/**/*'
731
+ - '/**/test/**/*'
732
+
733
+ Chef/Ruby/RequireNetHttps:
734
+ Description: net/https is deprecated and just includes net/http and openssl. We should include those directly instead
735
+ Enabled: true
736
+ VersionAdded: '1.3.0'
737
+
738
+ Chef/Ruby/LegacyPowershellOutMethods:
739
+ Description: Use powershell_exec!/powershell_exec instead of the slower legacy powershell_out!/powershell_out methods.
740
+ Enabled: true
741
+ VersionAdded: '1.6.0'