Open knightorc opened 6 years ago
Same issue for "templates" folder name nested under templates folder
example: ./templates/default/foldername/templates
results in FC011 FC031 FC071 for foldername folder
whoa @knightorc you are right, I had an attributes.rb
file in attributes
directory, hmm wierd bug.
This bug was introduced when I attempted to fix Foodcritic not finding mycookbook/recipe.rb or mycookbook/attribute.rb. I'm going to have to clean up that logic and I have several new failure states to add specs for so I can make sure we always detect the right thing without casting our net too wide. It's surprisingly difficult to get this right.
@tas50 We're not blocked, as our solution was to rename the recipe in our case. Thanks for all your efforts. It is appreciated.
Glad to know this is being looked upon, I also followed the approach @knightorc mentioned to get around this. :+1:
Confirm, same issue here with an recipe/attributes.rb
recipe file present:
foodcritic -V
foodcritic 14.0.0
FC011: Missing README in markdown format: recipes/README.md:1
FC031: Cookbook without metadata.rb file: recipes/metadata.rb:1
FC069: Ensure standardized license defined in metadata: ./metadata.rb:1
FC071: Missing LICENSE file: recipes/LICENSE:1
FC078: Ensure cookbook shared under an OSI-approved open source license: ./metadata.rb:1
Renaming fixed the issue as workaround
I have the same issue with Foodcritic 15.1.0. I have an attributes recipe in my cookbooks recipe folder. With renaming the recipe, Foodcritic works as expected. I can confirm, that the workaround from @joe4dev works properly.
foodcritic 15.1.0 we faced similar issue for attributes/attributes.rb as well. after renaming the attributes.rb to default.rb it started working.
Hit a weird issue today after updating to Foodcritic 13.x.x from 12.3.0
We have a cookbook that defines attributes at the recipe level. The recipe is called attributes.rb Foodcritic when testing the cookbook treats the recipes folder as a nested cookbook. Simply renaming the recipe to foo_attributes.rb causes the cookbook to test fine.
Structure while failing:
Structure working: