Foodcritic / foodcritic

Lint tool for Chef cookbooks.
http://foodcritic.io
MIT License
408 stars 153 forks source link

FC011, FC031, & FC071 Fail when using root aliases #739

Closed drrk closed 6 years ago

drrk commented 6 years ago

If you use root aliases (ie attributes.rb or recipe.rb in cookbook root) FC011, FC031, and FC071 fail when they don't fail if not using root aliases.

Tested with Chef Development Kit Version: 2.4.17 with foodcritic 12.2.1

drrk commented 6 years ago

Some more detail:

Kimballs-MacBook-Pro:test-root-alias kimball$ tree . ├── Berksfile ├── Berksfile.lock ├── LICENSE ├── README.md ├── attributes │   └── attributes.rb ├── chefignore ├── metadata.rb ├── recipe.rb ├── spec │   ├── spec_helper.rb │   └── unit │   └── recipes │   └── default_spec.rb └── test └── smoke └── default └── default_test.rb

7 directories, 11 files Kimballs-MacBook-Pro:test-root-alias kimball$ foodcritic . Checking 4 files .x.. FC011: Missing README in markdown format: ../README.md:1 FC031: Cookbook without metadata.rb file: ../metadata.rb:1 FC071: Missing LICENSE file: ../LICENSE:1 Kimballs-MacBook-Pro:test-root-alias kimball$

drrk commented 6 years ago

Replicating cookbook: http://bowerham.net/test-root-alias.zip

Note I have patched my version of test-kitchen to work round the associated bug there: https://github.com/test-kitchen/test-kitchen/issues/1230

tas50 commented 6 years ago

This is now fixed on master and I'll get a release out today