Information Technology Reference
In-Depth Information
$
foodcritic .
FC008: Generated cookbook metadata needs updating: ./metadata.rb:2
FC008: Generated cookbook metadata needs updating: ./metadata.rb:3
As shown in
Figure 16-15
, when Foodcritic detects an issue in your Chef code, you can look
up more detail on the issue and how it can be fixed. In this case,
FC008
indicates that you
should modify the
metadata.rb
file
maintainer
and
maintainer_email
fields to be
something besides the default boilerplate text.
Let's modify the
metadata.rb
file appropriately.
Example 16-11
shows how we changed our
file.
Example 16-11. chefdk/apache-test/metadata.rb
name
'apache-test'
maintainer
'Mischa Taylor'
maintainer_email
'mischa@misheska.com'
license
'MIT'
description
'Installs/Configures apache-test'
long_description
'Installs/Configures apache-test'
version
'0.1.0'
Run Foodcritic again. It should now report that
FC008
is no longer an issue:
$
foodcritic .
Let's create one more issue with our code. We'll say that a Chef developer forgot to commit
a
README.md
file into source control. Simulate this state by renaming the
README.md
file. Run the following
move
command:
$
mv README.md README.md.old
Run Foodcritic as follows and you should see a new issue:
$
foodcritic .
FC011: Missing README in markdown format: ./README.md:1