Analyzing cookbooks with Foodcritic

Let's take a quick look at another static analysis test tool that is included with ChefDK. That tool is named Foodcritic. Like RuboCop, Foodcritic examines the code in your cookbooks for violations to its rules. However, where RuboCop is a generic Ruby linter, Foodcritic is a Chef-specific linting tool. The difference being that using RuboCop helps you to keep your cookbooks in line with Ruby best practices, and Foodcritic helps to keep your cookbooks in line with Chef best practices. Foodcritic currently has 61 built-in rules to evaluate your cookbooks and allows the creation and use of custom rules as well. Both tools have their value, and I suggest that there is a place for each one in your DevOps workflow. ...

Get Chef: Powerful Infrastructure Automation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.