RuboCop Decko

Gem Version

Wagn-specific analysis for your Wagn deck, as an extension to RuboCop. Heavily inspired by rubocop-rspec and rubocop-cask.

Installation

Just install the rubocop-decko gem

gem install rubocop-decko

or if you use bundler put this in your Gemfile

gem 'rubocop-decko'

Usage

You need to tell RuboCop to load the Decko extension. There are three ways to do this:

RuboCop configuration file

Put this into your .rubocop.yml:

require: rubocop-decko

Now you can run rubocop and it will automatically load the RuboCop Decko cops together with the standard cops.

Command line

rubocop --require rubocop-decko

Rake task

RuboCop::RakeTask.new do |task|
  task.requires << 'rubocop-decko'
end

The Cops

All cops are located under lib/rubocop/cop/decko, and contain examples/documentation.

In your .rubocop.yml, you may treat the Decko cops just like any other cop. For example:

Decko/ViewLength:
  Description: Avoid views longer than 15 lines of code.
  Enabled: true
  CountComments: false
  Max: 15

Contributing

  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

License

rubocop-cask is MIT licensed. See the accompanying file for the full text.