config/cookstyle.yml in cookstyle-5.3.6 vs config/cookstyle.yml in cookstyle-5.4.13

- old
+ new

@@ -1,8 +1,9 @@ AllCops: TargetRubyVersion: 2.4 Exclude: + - files/**/* - vendor/**/* - Guardfile ChefAttributes: Patterns: - attributes/.*\.rb @@ -35,10 +36,12 @@ EnforcedStyle: strings VersionAdded: '5.0.0' SupportedStyles: - strings - symbols + Exclude: + - '**/metadata.rb' Chef/CopyrightCommentFormat: Description: Properly format copyright dates in comment blocks and ensure dates are up to date Enabled: false VersionAdded: '5.0.0' @@ -51,38 +54,55 @@ Chef/CommentFormat: Description: Use Chef's unique format for comment headers Enabled: true VersionAdded: '5.0.0' +Chef/DefaultMetadataMaintainer: + Description: Metadata contains default maintainer information from the cookbook generator. Add actual cookbook maintainer information to the metadata.rb. + Enabled: true + VersionAdded: '5.4.0' + Include: + - '**/metadata.rb' + ############################### # Avoiding potential problems ############################### Chef/FileMode: Description: Use strings to represent file modes in Chef resources Enabled: true VersionAdded: '5.0.0' + Exclude: + - '**/metadata.rb' Chef/ServiceResource: Description: Use a service resource to start and stop services instead of execute resources Enabled: true VersionAdded: '5.0.0' + Exclude: + - '**/metadata.rb' Chef/NodeNormal: Description: Do not use the node.normal method Enabled: true VersionAdded: '5.1.0' + Exclude: + - '**/metadata.rb' Chef/NodeNormalUnless: Description: Do not use the node.normal_unless method Enabled: true VersionAdded: '5.1.0' + Exclude: + - '**/metadata.rb' Chef/TmpPath: Description: Use file_cache_path rather than hard-coding tmp paths Enabled: true VersionAdded: '5.0.0' + Exclude: + - '**/metadata.rb' Chef/InsecureCookbookURL: Description: Insecure http Github or Gitlab URLs for metadata source_url/issues_url fields Enabled: true VersionAdded: '5.1.0' @@ -114,20 +134,26 @@ Chef/NodeSet: Description: Do not use the deprecated node.set method Enabled: true VersionAdded: '5.0.0' + Exclude: + - '**/metadata.rb' Chef/NodeSetUnless: Description: Do not use the deprecated node.set_unless method Enabled: true VersionAdded: '5.1.0' + Exclude: + - '**/metadata.rb' Chef/EpicFail: Description: Use ignore_failure method instead of the deprecated epic_fail method Enabled: true VersionAdded: '5.1.0' + Exclude: + - '**/metadata.rb' Chef/CookbookDependsOnPoise: Description: Cookbooks should not depend on the deprecated Poise framework Enabled: true VersionAdded: '5.1.0' @@ -192,21 +218,57 @@ Chef/EasyInstallResource: Description: Don't use the deprecated easy_install resource resource removed in Chef 13 Enabled: true VersionAdded: '5.1.0' + Exclude: + - '**/metadata.rb' Chef/ErlCallResource: Description: Don't use the deprecated erl_call resource removed in Chef 13 Enabled: true VersionAdded: '5.1.0' + Exclude: + - '**/metadata.rb' Chef/RequireRecipe: Description: Use include_recipe instead of the require_recipe method Enabled: true VersionAdded: '5.2.0' + Exclude: + - '**/metadata.rb' +Chef/NodeMethodsInsteadofAttributes: + Description: Use node attributes to access Ohai data instead of node methods, which were deprecated in Chef Infra Client 13. + Enabled: true + VersionAdded: '5.4.0' + Exclude: + - '**/metadata.rb' + +Chef/UsesDeprecatedMixins: + Description: Don't use deprecated Mixins no longer included in Chef Infra Client 14 and later. + Enabled: true + VersionAdded: '5.4.0' + Include: + - '**/libraries/*.rb' + - '**/providers/*.rb' + +Chef/IncludingMixinShelloutInResources: + Description: There is no need to include Chef::Mixin::ShellOut in resources or providers as this is already done by Chef Infra Client. + Enabled: true + VersionAdded: '5.4.0' + Include: + - '**/resources/*.rb' + - '**/providers/*.rb' + +Chef/LegacyYumCookbookRecipes: + Description: The elrepo, epel, ius, remi, and repoforge recipes were split into their own cookbooks and the yum recipe was renamed to be default with the release of yum cookbook 3.0 (Dec 2013). + Enabled: true + VersionAdded: '5.4.0' + Exclude: + - '**/metadata.rb' + ############################### # Cleaning up Legacy Code ############################### Chef/LegacyBerksfileSource: @@ -215,11 +277,11 @@ VersionAdded: '5.1.0' Include: - '**/Berksfile' Chef/WhyRunSupportedTrue: - Description: why_run_supported? no longer needs to be set to true as it is the default in Chef 13+ + Description: whyrun_supported? no longer needs to be set to true as it is the default in Chef 13+ Enabled: true VersionAdded: '5.1.0' Include: - '**/resources/*.rb' - '**/providers/*.rb' @@ -325,9 +387,53 @@ Description: Use the apt_update resource instead of the execute resource to run an apt-get update package cache update Enabled: true VersionAdded: '5.3.0' Exclude: - '**/metadata.rb' + +Chef/WindowsZipfileUsage: + Description: Use the archive_file resource built into Chef Infra Client 15+ instead of the windows_zipfile from the Windows cookbook + Enabled: true + VersionAdded: '5.4.0' + Exclude: + - '**/metadata.rb' + +Chef/WindowsVersionHelper: + Description: Use node['platform_version'] data instead of the Windows::VersionHelper helper from the Windows cookbook. + Enabled: true + VersionAdded: '5.4.0' + Exclude: + - '**/metadata.rb' + +Chef/MinitestHandlerUsage: + Description: Use Chef InSpec for testing instead of the Minitest Handler cookbook pattern. + Enabled: true + VersionAdded: '5.4.0' + Include: + - '**/metadata.rb' + +Chef/IncludingOhaiDefaultRecipe: + Description: Use the ohai_plugin resource to ship custom Ohai plugins instead of using the ohai::default recipe. If you're not shipping custom Ohai plugins, then you can remove this recipe entirely. + Enabled: true + VersionAdded: '5.4.0' + Exclude: + - '**/metadata.rb' + +Chef/IncludingXMLRubyRecipe: + Description: The xml::ruby recipe installs nokogiri which is included in Chef Infra Client 12 and later. + Enabled: true + VersionAdded: '5.4.0' + Exclude: + - '**/metadata.rb' + +Chef/UseInlineResourcesDefined: + Description: use_inline_resources is now the default for resources in Chef Infra Client 13+ and does not need to be specified. + Enabled: true + VersionAdded: '5.4.0' + Include: + - '**/libraries/*.rb' + - '**/providers/*.rb' + - '**/resources/*.rb' ############################### # Detecting code that breaks Chef ###############################