foodcritic | Lint tool for Chef cookbooks | Code Analyzer library
kandi X-RAY | foodcritic Summary
kandi X-RAY | foodcritic Summary
Foodcritic is a code linting tool for writing better and safer Chef cookbooks that runs both as a command line tool and as a Rake task. Out of the box Foodcritic contains over 70 cookbook rules, and plugin system for writing your own rules.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Checks all the files in the cookbook .
- Create a cookbook
- Create a ruby recipe with the given name .
- Options for the command line
- Extracts notifications from an array of notifications
- Defines a command
- Extend the class to be included
- Create the default attributes file
- Create a resource file
- Create a recipe file
foodcritic Key Features
foodcritic Examples and Code Snippets
Community Discussions
Trending Discussions on foodcritic
QUESTION
Please help me I am being tortured by the linting squiggly and I cannot get rid of it. Here is the context
working in vscode 1.37.0
on a chef project (mostly ruby syntax)
I have the chef extension installed and chefdk installed an available in my path
And for the life of me I cannot get the linting warning for Style/PercentLiteralDelimiters
to go away. I will get this warning when I am using []
Then if I make the suggested change to ()
it wants me to flip it the other way.
I get the same results if I specify this rule in my rubocop.yml
...ANSWER
Answered 2019-Aug-20 at 17:52So thanks to the comment from Draco Alter I was able to figure out the issue I had.
First I had a miss understanding about Foodcritic and was conflating it with cookstyle. After understanding that and the comment that Draco made saying
Some of the rules in Cookstyle and Rubocop are conflicting - and %w is one of them.
I figured I would favor cookstyle as I am using ruby exclusively for chef. So I ensured rubocop was gone gem uninstall rubocop
and then I just needed to update my vscode workspace settings to have from
QUESTION
My food critic gem installation is failing with the below error
...ANSWER
Answered 2018-Jul-29 at 13:27Foodcritic 3.0.3 is from 2013. See here:
https://rubygems.org/gems/foodcritic/versions/3.0.3
Unfortunately it is not compatible with the latest version of Ruby. Your choices are to either downgrade Ruby to something less than 2.4, maybe even as low as 1.9 to be sure of compatibility, or upgrade foodcritic to its latest version (14.0.0).
QUESTION
I am getting a foodcritic error when I try to include a recipie within the default.rb for the apache cookbook lesson:
...ANSWER
Answered 2017-Nov-22 at 22:00The FC007 activation is wrong. Are you sure you're running foodcritic
correctly? Just run foodcritic .
on the base of the cookbook folder (i.e. the same place as the metadata.rb
is). That should detect the name of the cookbook and not flag the include.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install foodcritic
On a UNIX-like operating system, using your system’s package manager is easiest. However, the packaged Ruby version may not be the newest one. There is also an installer for Windows. Managers help you to switch between multiple Ruby versions on your system. Installers can be used to install a specific or multiple Ruby versions. Please refer ruby-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page