How do i test my chef cookbooks for syntax?
-
rubocop help: http://bit.ly/2qmnCk1
rubocop is for Ruby in general, not specifically for chef.
Make sure you are in your chef-repo directory.
$ rubocop Inspecting 9 files ..C...... Offenses: cookbooks/cowsay/recipes/default.rb:7:9: C: Prefer single-quoted strings when you don't need string interpolation or special symbols. package "cowsay" do ^^^^^^^^ cookbooks/cowsay/recipes/default.rb:8:1: C: Use 2 (not 3) spaces for indentation. action :install ^^^ 9 files inspected, 2 offenses detected
After correcting the errors.
$ rubocop Inspecting 9 files ......... 9 files inspected, no offenses detected
© Lightnetics 2024