config/cookstyle.yml in cookstyle-5.0.4 vs config/cookstyle.yml in cookstyle-5.1.19

- old
+ new

@@ -23,40 +23,228 @@ - recipes/.*\.rb ChefResources: Patterns: - resources/.*\.rb +############################### +# Making cookbooks look better +############################### + Chef/AttributeKeys: Description: Check which style of keys are used to access node attributes. Enabled: true EnforcedStyle: strings + VersionAdded: '5.0.0' SupportedStyles: - strings - symbols +Chef/CopyrightCommentFormat: + Description: Properly format copyright dates in comment blocks and ensure dates are up to date + Enabled: false + VersionAdded: '5.0.0' + +Chef/CommentSentenceSpacing: + Description: Use a single space after sentences in comments + Enabled: false + VersionAdded: '5.1.0' + +Chef/CommentFormat: + Description: Use Chef's unique format for comment headers + Enabled: true + VersionAdded: '5.0.0' + +############################### +# Avoiding potential problems +############################### + Chef/FileMode: Description: Use strings to represent file modes in Chef resources Enabled: true + VersionAdded: '5.0.0' Chef/ServiceResource: Description: Use a service resource to start and stop services instead of execute resources Enabled: true + VersionAdded: '5.0.0' -Chef/CopyrightCommentFormat: - Description: Properly format copyright dates in comment blocks and ensure dates are up to date - Enabled: false +Chef/NodeNormal: + Description: Do not use the node.normal method + Enabled: true + VersionAdded: '5.1.0' -Chef/CommentFormat: - Description: Use Chef's unique format for comment headers +Chef/NodeNormalUnless: + Description: Do not use the node.normal_unless method Enabled: true + VersionAdded: '5.1.0' +Chef/TmpPath: + Description: Use file_cache_path rather than hard-coding tmp paths + Enabled: true + VersionAdded: '5.0.0' + +Chef/InsecureCookbookURL: + Description: Insecure http Github or Gitlab URLs for metadata source_url/issues_url fields + Enabled: true + VersionAdded: '5.1.0' + Include: + - '**/metadata.rb' + +Chef/NamePropertyIsRequired: + Description: Resource properties marked as name properties should not also be required properties + Enabled: true + VersionAdded: '5.1.0' + +############################### +# Resolving Deprecations +############################### + Chef/NodeSet: Description: Do not use the deprecated node.set method Enabled: true + VersionAdded: '5.0.0' -Chef/TmpPath: - Description: Use file_cache_path rather than hard-coding tmp paths +Chef/NodeSetUnless: + Description: Do not use the deprecated node.set_unless method Enabled: true + VersionAdded: '5.1.0' + +Chef/EpicFail: + Description: Use ignore_failure method instead of the deprecated epic_fail method + Enabled: true + VersionAdded: '5.1.0' + +Chef/CookbookDependsOnPoise: + Description: Cookbooks should not depend on the deprecated Poise framework + Enabled: true + VersionAdded: '5.1.0' + Include: + - '**/metadata.rb' + +Chef/ConflictsMetadata: + Description: Don't use the deprecated 'conflicts' metadata value + Enabled: true + VersionAdded: '5.1.0' + Include: + - '**/metadata.rb' + +Chef/SuggestsMetadata: + Description: Don't use the deprecated 'suggests' metadata value + Enabled: true + VersionAdded: '5.1.0' + Include: + - '**/metadata.rb' + +Chef/ProvidesMetadata: + Description: Don't use the deprecated 'provides' metadata value + Enabled: true + VersionAdded: '5.1.0' + Include: + - '**/metadata.rb' + +Chef/ReplacesMetadata: + Description: Don't use the deprecated 'replaces' metadata value + Enabled: true + VersionAdded: '5.1.0' + Include: + - '**/metadata.rb' + +Chef/AttributeMetadata: + Description: Don't use the deprecated 'attribute' metadata value + Enabled: true + VersionAdded: '5.1.0' + Include: + - '**/metadata.rb' + +Chef/CookbookDependsOnCompatResource: + Description: Don't depend on the deprecated compat_resource cookbook made obsolete by Chef 12.19+ + Enabled: true + VersionAdded: '5.1.0' + Include: + - '**/metadata.rb' + +Chef/CookbookDependsOnPartialSearch: + Description: Don't depend on the deprecated partial_search cookbook made obsolete by Chef 13+ + Enabled: true + VersionAdded: '5.1.0' + Include: + - '**/metadata.rb' + +Chef/EasyInstallResource: + Description: Don't use the deprecated easy_install resource resource removed in Chef 13 + Enabled: true + VersionAdded: '5.1.0' + +Chef/ErlCallResource: + Description: Don't use the deprecated erl_call resource removed in Chef 13 + Enabled: true + VersionAdded: '5.1.0' + +############################### +# Cleaning up Legacy Code +############################### + +Chef/LegacyBerksfileSource: + Description: Do not use legacy Berksfile community sources. Use Chef Supermarket instead. + Enabled: true + 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+ + Enabled: true + VersionAdded: '5.1.0' + Include: + - '**/resources/.*\.rb' + - '**/providers/.*\.rb' + - '**/libraries/.*\.rb' + +PropertyWithNameAttribute: + Description: Resource property sets name_attribute not name_property + Enabled: true + VersionAdded: '5.1.0' + Include: + - '**/resources/.*\.rb' + - '**/libraries/.*\.rb' + +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' + +Chef/UnnecessaryDependsChef14: + Description: Don't depend on cookbooks made obsolete by Chef 14 + Enabled: true + VersionAdded: '5.1.0' + Include: + - '**/metadata.rb' + +############################### +# Utilize new built-in resources +############################### + +Chef/UseBuildEssentialResource: + Description: Use the build_essential resource instead of the legacy build-essential recipe + Enabled: false + VersionAdded: '5.1.0' + +############################### +# Migrating to new patterns +############################### + +Chef/CookbookUsesSearch: + Description: Cookbook uses search, which cannot be used in the Effortless Infra pattern + Enabled: false + VersionAdded: '5.1.0' + +Chef/CookbookUsesDatabags: + Description: Cookbook uses data bags, which cannot be used in the Effortless Infra pattern + Enabled: false + VersionAdded: '5.1.0' #### The base rubocop 0.37 enabled.yml file we started with #### Layout/AccessModifierIndentation: Enabled: true