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
109
stars
54
forks
source link
Add chefstyle library file for Rake backwards compatibility #969
There's a decent amount of Rake code that uses require "chefstyle" to set the defaults for RuboCop (eg
https://github.com/chef/ohai/blob/6d64237f9987c3bf51805e19884e6e710c3a40f6/Rakefile#L19), and rather than doing surgery on each repo's Rakefile, it'd be easier to keep that same behavior for loading the configuration and cops. With this change a migration involving Rake should only involve a Gemfile update and changing require "chefstyle" to require "cookstyle/chefstyle".
Related Issue
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] Chore (non-breaking change that does not add functionality or fix an issue)
Checklist:
[x] I have read the CONTRIBUTING document.
[x] I have run the pre-merge tests locally and they pass.
[ ] I have updated the documentation accordingly.
[ ] I have added tests to cover my changes.
[ ] If Gemfile.lock has changed, I have used --conservative to do it and included the full output in the Description above.
Description
There's a decent amount of Rake code that uses
require "chefstyle"
to set the defaults for RuboCop (eg https://github.com/chef/ohai/blob/6d64237f9987c3bf51805e19884e6e710c3a40f6/Rakefile#L19), and rather than doing surgery on each repo's Rakefile, it'd be easier to keep that same behavior for loading the configuration and cops. With this change a migration involving Rake should only involve a Gemfile update and changingrequire "chefstyle"
torequire "cookstyle/chefstyle"
.Related Issue
Types of changes
Checklist:
Gemfile.lock
has changed, I have used--conservative
to do it and included the full output in the Description above.