Skip to content

Commit

Permalink
Allow departments to be enabled/disabled by users
Browse files Browse the repository at this point in the history
Over in rubocop/rubocop#9752 we figured out
that the reason end-users can't enable/disable Cookstyle departments is
because `Enabled` isn't in the config and thus [can't be
overridden](rubocop/rubocop#9752 (comment)).

This change will allow a user to not only do the obvious:

```yaml
Chef/Correctness:
  Enabled: false
```

But more interestingly do something like this:

```yaml
AllCops:
  DisabledByDefault: true

Chef/Correctness:
  Enabled: true
```

CC @jonas054
  • Loading branch information
jaymzh committed Jan 22, 2022
1 parent f5acdd8 commit a424880
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions config/cookstyle.yml
Expand Up @@ -12,6 +12,7 @@ AllCops:
###############################

Chef/Style:
Enabled: true
StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/

Chef/Style/AttributeKeys:
Expand Down Expand Up @@ -156,6 +157,7 @@ Chef/Style/IncludeRecipeWithParentheses:
###############################

Chef/Correctness:
Enabled: true
StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/

Chef/Correctness/ServiceResource:
Expand Down Expand Up @@ -529,6 +531,7 @@ Chef/Correctness/InvalidNotificationResource:
###############################

Chef/Sharing:
Enabled: true
StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/

Chef/Sharing/InsecureCookbookURL:
Expand Down Expand Up @@ -597,6 +600,7 @@ Chef/Sharing/IncludeResourceExamples:
###############################

Chef/Deprecations:
Enabled: true
StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/

Chef/Deprecations/NodeDeepFetch:
Expand Down Expand Up @@ -1301,6 +1305,7 @@ Chef/Deprecations/DependsOnOmnibusUpdaterCookbook:
###############################

Chef/Modernize:
Enabled: true
StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/

Chef/Modernize/LegacyBerksfileSource:
Expand Down Expand Up @@ -1973,6 +1978,7 @@ Chef/Modernize/DeclareActionClass:
###############################

Chef/RedundantCode:
Enabled: true
StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/

Chef/RedundantCode/ConflictsMetadata:
Expand Down Expand Up @@ -2195,6 +2201,7 @@ Chef/RedundantCode/DoubleCompileTime:
###############################

Chef/Effortless:
Enabled: true
StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/

Chef/Effortless/CookbookUsesSearch:
Expand Down

0 comments on commit a424880

Please sign in to comment.