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
Refactor Chef/Deprecations/Delivery to address caching issues #951
RuboCop inspects files not directories. In order to report an offense for the existence of a .delivery directory, the Delivery cop performs the checks and makes its report when asked to inspect the metadata.rb file. On subsequent runs, RuboCop will see that the content of metadata.rb has not changed, and report the cached offense form the Delivery cop, even after the .delivery directory is removed.
This patch refactors the Delivery cop to report offenses for the existence of the files .delivery/config.json (Chef Delivery config) and .delivery/project.toml (Chef Delivery Local config), instead of trying to check for the existence of a directory.
Related Issue
Fixes #942
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[ ] 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.
Signed-off-by: Doug Knight doug.knight@karmix.org
Description
RuboCop inspects files not directories. In order to report an offense for the existence of a
.delivery
directory, the Delivery cop performs the checks and makes its report when asked to inspect themetadata.rb
file. On subsequent runs, RuboCop will see that the content ofmetadata.rb
has not changed, and report the cached offense form the Delivery cop, even after the.delivery
directory is removed.This patch refactors the Delivery cop to report offenses for the existence of the files
.delivery/config.json
(Chef Delivery config) and.delivery/project.toml
(Chef Delivery Local config), instead of trying to check for the existence of a directory.Related Issue
Fixes #942
Types of changes
Checklist: