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

[chefstyle] import Chefstyle cops and config #968

Closed dafyddcrosby closed 7 months ago

dafyddcrosby commented 8 months ago

Description

There's already a lot of overlap with Chefstyle, and maintaining one repo instead of two makes development and maintenance easier for everyone. I've imported the files from main (currently https://github.com/chef/chefstyle/tree/129344227d927ea67f228540654a6718265d03cd) and only changed chefstyle.yml as Chef/Ruby/Ruby27KeywordArgumentWarnings is already available in Cookstyle as Chef/Deprecations/Ruby27KeywordArgumentWarnings.

To run the chefstyle configs one uses the --chefstyle argument (captured in bin/cookstyle to avoid more invasive patching of RuboCop), which uses chefstyle.yml instead of cookstyle.yml.

Diff of bin/chefstyle --show-cops in chefstyle repo and bin/cookstyle --chefstyle --show-cops: https://gist.github.com/dafyddcrosby/417dde82d1507313f59dae80898c5271

While this makes the imported Chef/Ruby cops available to Cookstyle, they are disabled by default. Before and after diff of cookstyle --show-cops: https://gist.github.com/dafyddcrosby/922112f26f0d90f66a4d7b832f7a465a

Related Issue

Types of changes

Checklist:

sonarcloud[bot] commented 7 months ago

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud