Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: AllCops does not support TargetChefVersion parameter #970

Open
slabstone opened this issue Apr 11, 2024 · 2 comments
Open

Warning: AllCops does not support TargetChefVersion parameter #970

slabstone opened this issue Apr 11, 2024 · 2 comments
Labels
Status: Untriaged An issue that has yet to be triaged. Type: Bug Does not work as expected.

Comments

@slabstone
Copy link

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
@slabstone slabstone added Status: Untriaged An issue that has yet to be triaged. Type: Bug Does not work as expected. labels Apr 11, 2024
@dafyddcrosby
Copy link
Contributor

Got a repro on my end (excellent report, btw <3), suspect it's due to #965, looking at it now

@dafyddcrosby
Copy link
Contributor

Got a fix in 5ac8375, will clean it up to merge in the morning

dafyddcrosby added a commit to dafyddcrosby/cookstyle that referenced this issue May 15, 2024
We need to pass TargetChefVersion into the default config, otherwise the
[ConfigValidator#each_invalid_parameter method
complains](https://github.com/rubocop/rubocop/blob/2fee8552c6c8237950d8df7ec857c49f308a6d34/lib/rubocop/config_validator.rb#L198)

Signed-off-by: David Crosby <dcrosby@fb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Untriaged An issue that has yet to be triaged. Type: Bug Does not work as expected.
Projects
None yet
Development

No branches or pull requests

2 participants