Cookstyle added to ChefDK

Hi Chefs,

I recently merged a change to add cookstyle to ChefDK. The latest build in
the current channel contains this change and it will be included in the next
stable release.

What’s cookstyle?

cookstyle is a linting tool based on rubocop. We created cookstyle
to address two issues with rubocop:

  1. New releases of rubocop usually contain new style rules, which causes
    most projects to fail style checks after updating rubocop.
  2. rubocop’s default configuration enables many checks which are not
    appropriate for cookbook development.

cookstyle fixes these by pinning to an exact version of rubocop and
replacing the default configuration with one that we’ve customized to
work better for cookbook development. When a new version of rubocop is
released, we run an automated process to disable new style rules in the
default configuration, which allows you to update with confidence.

In the future, we plan to version cookstyle’s ruleset so we can deliver
updates but give you control over when changes take place.

If you have any suggestions for changes to the default ruleset in
cookstyle, please create a pull request.

For more information about cookstyle, see the README on github.

1 Like