Foodcritic / foodcritic

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

Improve tag loading from rule files #754

Closed tas50 closed 6 years ago

tas50 commented 6 years ago

Cache the lookups per cookbook so we don't have to go looking for a .foodcritic file for every file we find in the cookbook. In our chef-cookbooks org this reduces the number of times we check disk for the .foodcritic file and then parse its contents from 1379 (1 per file) to 120 (1 per cookbook). This reduces the Foodcritic runtime by 2.83% on my system with a nice fast SSD. That percent is only going to go up as disk gets slower.

The PR also improves failure behaviors with bad/missing rule files:

Signed-off-by: Tim Smith tsmith@chef.io