config/cookstyle.yml in cookstyle-5.14.1 vs config/cookstyle.yml in cookstyle-5.15.7

- old
+ new

@@ -113,29 +113,10 @@ Enabled: true VersionAdded: '5.0.0' Exclude: - '**/metadata.rb' -ChefCorrectness/InsecureCookbookURL: - Description: Insecure http Github or Gitlab URLs for metadata source_url/issues_url fields - Enabled: true - VersionAdded: '5.1.0' - Include: - - '**/metadata.rb' - -ChefCorrectness/NamePropertyIsRequired: - Description: Resource properties marked as name properties should not also be required properties - Enabled: true - VersionAdded: '5.1.0' - -ChefCorrectness/InvalidLicenseString: - Description: Cookbook metadata.rb does not use a SPDX compliant license string or "all rights reserved" - Enabled: true - VersionAdded: '5.2.0' - Include: - - '**/metadata.rb' - ChefCorrectness/InvalidPlatformMetadata: Description: metadata.rb "supports" platform is invalid Enabled: true VersionAdded: '5.2.0' Include: @@ -146,33 +127,10 @@ Enabled: true VersionAdded: '5.5.0' Exclude: - '**/metadata.rb' -ChefCorrectness/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' - -ChefCorrectness/PropertyWithNameAttribute: - Description: Resource property sets name_attribute not name_property - Enabled: true - VersionAdded: '5.1.0' - Include: - - '**/resources/*.rb' - - '**/libraries/*.rb' - -ChefCorrectness/PropertyWithRequiredAndDefault: - Description: Resource property should not be both required and have a default value - Enabled: true - VersionAdded: '5.1.0' - Include: - - '**/resources/*.rb' - - '**/libraries/*.rb' - ChefCorrectness/CookbooksDependsOnSelf: Description: A cookbook cannot depend on itself Enabled: true VersionAdded: '5.2.0' Include: @@ -211,32 +169,10 @@ Enabled: true VersionAdded: '5.5.0' Exclude: - '**/metadata.rb' -ChefCorrectness/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' - -ChefCorrectness/UnnecessaryNameProperty: - Description: There is no need to define a property named :name in a resource as Chef Infra defines that property for all resources by default. - Enabled: true - VersionAdded: '5.8.0' - Include: - - '**/resources/*.rb' - - '**/libraries/*.rb' - -ChefCorrectness/EmptyMetadataField: - Description: metadata.rb should not include fields with an empty string. Either don't include the field or add a value. - Enabled: true - VersionAdded: '5.8.0' - Include: - - '**/metadata.rb' - ChefCorrectness/InvalidVersionMetadata: Description: Cookbook metadata.rb version field should follow X.Y.Z version format. Enabled: true VersionAdded: '5.8.0' Include: @@ -254,104 +190,117 @@ Enabled: true VersionAdded: '5.10.0' Include: - '**/libraries/*.rb' -ChefCorrectness/ResourceWithNothingAction: - Description: There is no need to define a :nothing action in your resource as Chef Infra Client provides the :nothing action by default for every resource. +ChefCorrectness/InvalidPlatformHelper: + Description: Pass valid platforms to the platform? helper. Enabled: true - VersionAdded: '5.12.0' - Include: - - '**/libraries/*.rb' - - '**/resources/*.rb' - - '**/providers/*.rb' + VersionAdded: '5.15.0' + Exclude: + - '**/metadata.rb' -############################### -# ChefDeprecations: Resolving Deprecations that block upgrading Chef Infra Client -############################### - -ChefDeprecations/NodeDeepFetch: - Description: Do not use the deprecated chef-sugar node.deep_fetch methods +ChefCorrectness/InvalidPlatformFamilyHelper: + Description: Pass valid platform families to the platform_family? helper. Enabled: true - VersionAdded: '5.12.0' + VersionAdded: '5.15.0' Exclude: - '**/metadata.rb' -ChefDeprecations/NodeSet: - Description: Do not use the deprecated node.set method +ChefCorrectness/ScopedFileExist: + Description: Scope file exist to access the correct File class by using ::File.exist? not File.exist?. Enabled: true - VersionAdded: '5.0.0' + VersionAdded: '5.15.0' Exclude: - '**/metadata.rb' -ChefDeprecations/NodeSetUnless: - Description: Do not use the deprecated node.set_unless method +ChefCorrectness/InvalidPlatformValueForPlatformFamilyHelper: + Description: Pass valid platforms families to the value_for_platform_family helper. Enabled: true - VersionAdded: '5.1.0' + VersionAdded: '5.15.0' Exclude: - '**/metadata.rb' -ChefDeprecations/EpicFail: - Description: Use ignore_failure method instead of the deprecated epic_fail method +ChefCorrectness/InvalidPlatformValueForPlatformHelper: + Description: Pass valid platforms to the value_for_platform helper. Enabled: true - VersionAdded: '5.1.0' + VersionAdded: '5.15.0' Exclude: - '**/metadata.rb' -ChefDeprecations/CookbookDependsOnPoise: - Description: Cookbooks should not depend on the deprecated Poise framework +############################### +# ChefSharing: Issues that prevent sharing code with other teams or with the Chef community in general +############################### + +ChefSharing/InsecureCookbookURL: + Description: Insecure http Github or Gitlab URLs for metadata source_url/issues_url fields Enabled: true VersionAdded: '5.1.0' + VersionChanged: '5.15.0' Include: - '**/metadata.rb' -ChefDeprecations/ConflictsMetadata: - Description: Don't use the deprecated 'conflicts' metadata value +ChefSharing/InvalidLicenseString: + Description: Cookbook metadata.rb does not use a SPDX compliant license string or "all rights reserved" Enabled: true - VersionAdded: '5.1.0' + VersionAdded: '5.2.0' + VersionChanged: '5.15.0' Include: - '**/metadata.rb' -ChefDeprecations/SuggestsMetadata: - Description: Don't use the deprecated 'suggests' metadata value +ChefSharing/DefaultMetadataMaintainer: + Description: Metadata contains default maintainer information from the cookbook generator. Add actual cookbook maintainer information to the metadata.rb. Enabled: true - VersionAdded: '5.1.0' + VersionAdded: '5.4.0' + VersionChanged: '5.15.0' Include: - '**/metadata.rb' -ChefDeprecations/ProvidesMetadata: - Description: Don't use the deprecated 'provides' metadata value +ChefSharing/EmptyMetadataField: + Description: metadata.rb should not include fields with an empty string. Either don't include the field or add a value. Enabled: true - VersionAdded: '5.1.0' + VersionAdded: '5.8.0' + VersionChanged: '5.15.0' Include: - '**/metadata.rb' -ChefDeprecations/ReplacesMetadata: - Description: Don't use the deprecated 'replaces' metadata value +############################### +# ChefDeprecations: Resolving Deprecations that block upgrading Chef Infra Client +############################### + +ChefDeprecations/NodeDeepFetch: + Description: Do not use the deprecated chef-sugar node.deep_fetch methods Enabled: true - VersionAdded: '5.1.0' - Include: + VersionAdded: '5.12.0' + Exclude: - '**/metadata.rb' -ChefDeprecations/AttributeMetadata: - Description: Don't use the deprecated 'attribute' metadata value +ChefDeprecations/NodeSet: + Description: Do not use the deprecated node.set method Enabled: true + VersionAdded: '5.0.0' + Exclude: + - '**/metadata.rb' + +ChefDeprecations/NodeSetUnless: + Description: Do not use the deprecated node.set_unless method + Enabled: true VersionAdded: '5.1.0' - Include: + Exclude: - '**/metadata.rb' -ChefDeprecations/LongDescriptionMetadata: - Description: The long_description metadata.rb method is not used and is unnecessary in cookbooks +ChefDeprecations/EpicFail: + Description: Use ignore_failure method instead of the deprecated epic_fail method Enabled: true - VersionAdded: '5.2.0' - Include: + VersionAdded: '5.1.0' + Exclude: - '**/metadata.rb' -ChefDeprecations/RecipeMetadata: - Description: The recipe metadata.rb method is not used and is unnecessary in cookbooks. Recipes should be documented in the README.md file instead. +ChefDeprecations/CookbookDependsOnPoise: + Description: Cookbooks should not depend on the deprecated Poise framework Enabled: true - VersionAdded: '5.6.0' + VersionAdded: '5.1.0' Include: - '**/metadata.rb' ChefDeprecations/CookbookDependsOnCompatResource: Description: Don't depend on the deprecated compat_resource cookbook made obsolete by Chef 12.19+ @@ -696,18 +645,10 @@ Enabled: true VersionAdded: '5.2.0' Include: - '**/resources/*.rb' -ChefModernize/CustomResourceWithAllowedActions: - Description: Resources no longer need to define the allowed actions using the allowed_actions / actions helper methods or within an initialize method. - Enabled: true - VersionAdded: '5.2.0' - Include: - - '**/resources/*.rb' - - '**/libraries/*.rb' - ChefModernize/IncludingAptDefaultRecipe: Description: Do not include the Apt default recipe to update package cache. Instead use the apt_update resource, which is built into Chef Infra Client 12.7 and later. Enabled: true VersionAdded: '5.3.0' Exclude: @@ -941,9 +882,139 @@ Enabled: true VersionAdded: '5.14.0' Exclude: - '**/metadata.rb' - '**/attributes/*.rb' + +ChefModernize/PropertyWithNameAttribute: + Description: Resource property sets name_attribute not name_property + Enabled: true + VersionAdded: '5.1.0' + VersionChanged: '5.15.0' + Include: + - '**/resources/*.rb' + - '**/libraries/*.rb' + +ChefModernize/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' + VersionChanged: '5.15.0' + Exclude: + - '**/metadata.rb' + +ChefModernize/AllowedActionsFromInitialize: + Description: The allowed actions of a resource can be set with the "allowed_actions" helper instead of using the initialize method. + Enabled: true + VersionAdded: '5.15.0' + Include: + - '**/resources/*.rb' + - '**/libraries/*.rb' + +############################### +# ChefRedundantCode: Cleanup unncessary code in your cookbooks regardless of chef-client release +############################### + +ChefRedundantCode/ConflictsMetadata: + Description: Don't use the deprecated 'conflicts' metadata value + Enabled: true + VersionAdded: '5.1.0' + VersionChanged: '5.15.0' + Include: + - '**/metadata.rb' + +ChefRedundantCode/SuggestsMetadata: + Description: Don't use the deprecated 'suggests' metadata value + Enabled: true + VersionAdded: '5.1.0' + VersionChanged: '5.15.0' + Include: + - '**/metadata.rb' + +ChefRedundantCode/ProvidesMetadata: + Description: Don't use the deprecated 'provides' metadata value + Enabled: true + VersionAdded: '5.1.0' + VersionChanged: '5.15.0' + Include: + - '**/metadata.rb' + +ChefRedundantCode/ReplacesMetadata: + Description: Don't use the deprecated 'replaces' metadata value + Enabled: true + VersionAdded: '5.1.0' + VersionChanged: '5.15.0' + Include: + - '**/metadata.rb' + +ChefRedundantCode/AttributeMetadata: + Description: Don't use the deprecated 'attribute' metadata value + Enabled: true + VersionAdded: '5.1.0' + VersionChanged: '5.15.0' + Include: + - '**/metadata.rb' + +ChefRedundantCode/LongDescriptionMetadata: + Description: The long_description metadata.rb method is not used and is unnecessary in cookbooks + Enabled: true + VersionAdded: '5.2.0' + VersionChanged: '5.15.0' + Include: + - '**/metadata.rb' + +ChefRedundantCode/RecipeMetadata: + Description: The recipe metadata.rb method is not used and is unnecessary in cookbooks. Recipes should be documented in the README.md file instead. + Enabled: true + VersionAdded: '5.6.0' + VersionChanged: '5.15.0' + Include: + - '**/metadata.rb' + +ChefRedundantCode/ResourceWithNothingAction: + Description: There is no need to define a :nothing action in your resource as Chef Infra Client provides the :nothing action by default for every resource. + Enabled: true + VersionAdded: '5.12.0' + VersionChanged: '5.15.0' + Include: + - '**/libraries/*.rb' + - '**/resources/*.rb' + - '**/providers/*.rb' + +ChefRedundantCode/UnnecessaryNameProperty: + Description: There is no need to define a property named :name in a resource as Chef Infra defines that property for all resources by default. + Enabled: true + VersionAdded: '5.8.0' + VersionChanged: '5.15.0' + Include: + - '**/resources/*.rb' + - '**/libraries/*.rb' + +ChefRedundantCode/PropertyWithRequiredAndDefault: + Description: Resource property should not be both required and have a default value + Enabled: true + VersionAdded: '5.1.0' + VersionChanged: '5.15.0' + Include: + - '**/resources/*.rb' + - '**/libraries/*.rb' + +ChefRedundantCode/NamePropertyIsRequired: + Description: Resource properties marked as name properties should not also be required properties + Enabled: true + VersionAdded: '5.1.0' + VersionChanged: '5.15.0' + Include: + - '**/resources/*.rb' + - '**/libraries/*.rb' + +ChefRedundant/CustomResourceWithAllowedActions: + Description: It is not necessary to set `actions` or `allowed_actions` in custom resources as Chef Infra Client determines these automatically from the set of all actions defined in the resource. + Enabled: true + VersionAdded: '5.2.0' + VersionChanged: '5.15.0' + Include: + - '**/resources/*.rb' ############################### # Migrating to new patterns ###############################