0.0
No commit activity in last 3 years
No release in over 3 years
Guard::Cookstyle automatically checks Ruby code style with Cookstyle when files are modified.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 10.0
~> 3.0

Runtime

 Project Readme

Guard::Cookstyle

Gem Version

guard-cookstyle allows you to automatically check Chef cookbook style with Cookstyle when files are modified.

Cookstyle is a wrapper of rubocop, so most of the codes were based on yujinakayama/guard-rubocop.

Installation

Add this line to your application's Gemfile:

gem 'guard-cookstyle'

And then execute:

$ bundle

Or install it yourself as:

$ gem install guard-cookstyle

Add the default Guard::Cookstyle definition to your Guardfile by running:

$ guard init cookstyle

Usage

Please read the Guard usage documentation.

Options

You can pass some options in Guardfile like the following example:

guard :cookstyle, all_on_start: false, cli: ['--format', 'clang'], cookbook_dirs: ['mycookbooks'] do
  # ...
end

Available Options

all_on_start: true     # Check all files at Guard startup.
                       #   default: true
cli: '--rails'         # Pass arbitrary Cookstyle CLI arguments. (almost same of RuboCop)
                       # An array or string is acceptable.
                       #   default: nil
hide_stdout: false     # Do not display console output (in case outputting to file).
                       #   default: false
keep_failed: true      # Keep failed files until they pass.
                       #   default: true
notification: :failed  # Display Growl notification after each run.
                       #   true    - Always notify
                       #   false   - Never notify
                       #   :failed - Notify only when failed
                       #   default: :failed
launchy: nil           # Filename to launch using Launchy after RuboCop runs.
                       #   default: nil
cookbook_dirs: []      # Directory of Cookbooks to check.
                       #   default: %w[cookbooks site-cookbooks]

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/higanworks/guard-cookstyle.

License

Licensed under the Apache License, Version 2.0.