Gem Version Dependency Status Build Status Coverage Status Code Climate


Guard::Rubocop allows you to automatically check Ruby code style with RuboCop when files are modified.

Tested on MRI 1.9, MRI 2.0, JRuby and Rubinius in 1.9 modes.


Please make sure to have Guard installed before continue.

Add guard-rubocop to your Gemfile:

group :development do
  gem 'guard-rubocop'

and then execute:

$ bundle install

or install it yourself as:

$ gem install guard-rubocop

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

$ guard init rubocop


Please read the Guard usage documentation.


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

guard :rubocop, all_on_start: false, cli: ['--format', 'clang', '--rails'] do
  # ...

Available Options

all_on_start: true     # Check all files at Guard startup.
                       #   default: true
cli: ['--rails']       # Pass arbitrary RuboCop CLI arguments.
                       # An array or string is acceptable.
                       #   default: nil
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


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request