Skip to content
This repository has been archived by the owner on Sep 19, 2020. It is now read-only.

foodcritic fails on shorthand cookbook naming #498

Closed
vinyar opened this issue Nov 16, 2016 · 2 comments
Closed

foodcritic fails on shorthand cookbook naming #498

vinyar opened this issue Nov 16, 2016 · 2 comments

Comments

@vinyar
Copy link

vinyar commented Nov 16, 2016

Functional code:

case node['platform_family']
when 'windows' 
  include_recipe '::windows'
when 'debian', 'rhel' 
  include_recipe '::linux'
end

Results of foodcritic:

$ foodcritic -f correctness .
FC007: Ensure recipe dependencies are reflected in cookbook metadata: ./recipes/default.rb:13
FC007: Ensure recipe dependencies are reflected in cookbook metadata: ./recipes/default.rb:15
FC008: Generated cookbook metadata needs updating: ./metadata.rb:2
FC008: Generated cookbook metadata needs updating: ./metadata.rb:3
FC009: Resource attribute not recognised: ./recipes/linux.rb:55
FC011: Missing README in markdown format: test/README.md:1
FC023: Prefer conditional attributes: ./test/recipes/default_test.rb:8
FC031: Cookbook without metadata file: test/metadata.rb:1
FC045: Metadata does not contain cookbook name: test/metadata.rb:1

Alternatively:

recipe:

case node['platform_family']
when 'windows' 
  include_recipe 'svops_exportc_usermgmt_linux::windows'
when 'debian', 'rhel' 
  include_recipe 'svops_exportc_usermgmt_linux::linux'
end

Foodcritic:

oodcritic -f correctness . -X spec -X test
FC008: Generated cookbook metadata needs updating: ./metadata.rb:2
FC008: Generated cookbook metadata needs updating: ./metadata.rb:3
FC009: Resource attribute not recognised: ./recipes/linux.rb:55
@tas50
Copy link
Contributor

tas50 commented Mar 29, 2017

Fixed by #526

@tas50 tas50 closed this as completed Mar 29, 2017
@vinyar
Copy link
Author

vinyar commented Apr 4, 2017

woot!! 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants