chef / cookstyle

A linting tool that helps you to write better Chef Infra cookbooks and InSpec profiles by detecting and automatically correcting style, syntax, and logic mistakes in your code.
Apache License 2.0
107 stars 54 forks source link

Warning: AllCops does not support TargetChefVersion parameter #970

Closed slabstone closed 2 months ago

slabstone commented 5 months ago

Version:

Cookstyle 7.32.8

Environment:

ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Cookstyle 7.32.8
RuboCop 1.25.1

Scenario:

Running cookstyle > 7.32.2 with TargetChefVersion specified in config

Steps to Reproduce:

gem install cookstyle -v '> 7.32.2'
touch test.rb
echo -e 'AllCops:\n  TargetChefVersion: 12.22' > .rubocop.yml
cookstyle test.rb

Expected Result:

Inspecting 1 file
.

1 file inspected, no offenses detected

Actual Result:

Warning: AllCops does not support TargetChefVersion parameter.

Supported parameters are:

  - RubyInterpreters
  - Include
  - Exclude
  - DefaultFormatter
  - DisplayCopNames
  - DisplayStyleGuide
  - StyleGuideBaseURL
  - DocumentationBaseURL
  - ExtraDetails
  - StyleGuideCopsOnly
  - EnabledByDefault
  - DisabledByDefault
  - NewCops
  - UseCache
  - MaxFilesInCache
  - CacheRootDirectory
  - AllowSymlinksInCacheRootDirectory
  - TargetRubyVersion
  - SuggestExtensions
  - Enabled
  - inherit_mode

Inspecting 1 file
.

1 file inspected, no offenses detected
dafyddcrosby commented 4 months ago

Got a repro on my end (excellent report, btw <3), suspect it's due to https://github.com/chef/cookstyle/pull/965, looking at it now

dafyddcrosby commented 4 months ago

Got a fix in https://github.com/chef/cookstyle/commit/5ac83756b959cb5a9a89618f0ba8049d34f7b742, will clean it up to merge in the morning