Hello boys and girls ,
This is more like of a malfunction in “knife” , because the command “knife cookbook test my-cookbook” does this :
[root@chef-learning]# knife cookbook test my-cookbook WARNING: DEPRECATED: Please use ChefSpec or Cookstyle to syntax-check cookbooks. checking my-cookbook Running syntax check on my-cookbook Validating ruby files FATAL: Cookbook file recipes/default.rb has a ruby syntax error: [root@chef-learning]#
I can deffinetly see the errors with “ruby -c cookbooks/my-cookbook/recipes/default.rb” , and i can also see it with " cookstyle cookbooks/my-cookbook" ,
SO far so good , but the thing is that " cookstyle cookbooks/my-cookbook" shows too may offenses besides the errors that ruby sees , and those extra offenses do not stop me to upload the cookbook , nor do they stop me from fine running my recipes
Examples of meaningless offenses :
“Extra blank line detected” , “Tab detected” , “Use 2 spaces for indentation in a hash, relative to the start of the line where the left curly brace is.” , “Extra blank line detected”
I am too lazy to run “ruby -c $PATH_OF_FILE” every time an error occurs in my “default.rb” script , how can I overcome this ?