Skip to content

linting

Russell Seymour edited this page Oct 16, 2018 · 2 revisions

Linting

This task allows three different types of litning to be performed on a cookbook.

  1. ChefStyle
  2. ChefSpec
  3. Foodcritic

The task assumes that a Rakefile has been configured for the cookbook that has the required Rake tasks configured for this Azure DevOps task to call.

Settings

The following settings are available on this task:

Setting Group Required Default Value Description
Display Name Yes Cookbook Link: Display name of the tasl. It will be displayed in the pipeline
Lint Action Yes Lint action to be performed
Lint Action Command Advanced No Rake task that is be executed
Lint Action Folder Advanced No $(Build.SourcesDirectory) Path in which the task should be executed. This is where the Rakefile is stored

Information

Each of the different lint actions have a default rake task associated with them.

Action Task
ChefStyle style:chef
ChefSpec spec
Foodcritic style:foodcritic

Your Rakefile may not have the same tasks in it, and although we encourage you to have consistency in your cookbooks, these task names can ber overridden.

For example if you want to execute a different task for the ChefStyle action, use the 'Lint Action Command' to set an alernative name, e.g. style:rubocop.

Clone this wiki locally