cookstyle | linting tool that helps you to write better Chef Infra | Code Analyzer library
kandi X-RAY | cookstyle Summary
kandi X-RAY | cookstyle Summary
Cookstyle is a code linting tool that helps you to write better Chef Infra cookbooks and InSpec profiles by detecting and automatically correcting style, syntax, logic, and security mistakes in your code. Cookstyle is powered by the RuboCop linting engine. RuboCop ships with over three-hundred rules, or cops, designed to detect common Ruby coding mistakes and enforce a common coding style. We've customized Cookstyle with a subset of those cops that we believe are perfectly tailored for cookbook development. We also ship 254 Chef Infra specific cops that catch common cookbook coding mistakes, cleanup portions of code that are no longer necessary, and detect deprecations that prevent cookbooks from running on the latest releases of Chef Infra Client. For complete usage documentation along with documentation for all the included cops see
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Calculates the target .
cookstyle Key Features
cookstyle Examples and Code Snippets
Community Discussions
Trending Discussions on cookstyle
QUESTION
I want to use cookstyle in a cicd pipeline. I currently am not linting at all though. right now I just want to catch syntax error that would actually cause the cookbook to fail execution
Can I have cookstyle only check for actual errors and not just style conventions?
...ANSWER
Answered 2020-Aug-16 at 06:13I suggest you should eventually enable most of the cookstyle linting rules. If enabling them right away creates an overwhelming amount of offenses, you can create an automatic configuration: a .rubocop_todo.yml file.
Yes. Cookstyle is based on rubocop, so actually in this case rubocop documentation suits.
https://docs.rubocop.org/rubocop/configuration.html#automatically-generated-configuration
It will disable the failing cops, and then you can enable them 1 by 1 and fix in small portions.
Run:
QUESTION
Currently, we commit Chef cookbooks to individual repos within our GitHub organization. We are configuring a Jenkins job per repo / cookbook which will execute cookstyle first when a commit occurs, and if cookstyle passes with no issues, it will execute Test Kitchen. We have a template Jenkins job we copy and configure for each cookbook we create.
Does anyone know if it's possible to have GitHub hooks in Jenkins to listen for commit events across the entire organization, and then execute cookstyle on a repo where a commit occurred that contain a Chef cookbook? I'd like to have one central job handling the lint testing for our organization.
...ANSWER
Answered 2017-Nov-14 at 17:21You can create github web hooks for your github organization and configure your jenkins with the help of github plugin. Refer this documentation to see how to configure
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install cookstyle
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