Skip to content

Latest commit

 

History

History
116 lines (83 loc) · 3.56 KB

README.md

File metadata and controls

116 lines (83 loc) · 3.56 KB

rubocop-hixonrails

Gem Version Build Status

RuboCop rules for Hix on Rails projects that use RSpec. Includes:

Easily extensible, created by Hix on Rails.

Installation

Add this line to your application's Gemfile:

group :test, :development do
  gem 'rubocop-hixonrails'
end

Do notice, that you do not need to include other rubocop-* gems in your Gemfile, this single one will suffice.

For a Ruby library, add this to your gemspec:

spec.add_development_dependency 'rubocop-hixonrails'

And then run:

$ bundle install

Usage

Create a .rubocop.yml with the following directives:

inherit_gem:
  rubocop-hixonrails:
    - default.yml

Now, run:

$ bundle exec rubocop

Configuration

All configuration goes to default.yml file.

Enable pending cops

The gem comes with an executable:

enable_pending_cops

To enable pending cops in the repository, simply run:

ruby bin/enable_pending_cops

This will:

  1. Override all cops marked as Enabled: pending in the latest core or extensions' versions installed.
  2. Automatically generate the .rubocop_todo.yml file, without generating Max: n directives.

This way you can safely update the code, one by one.

Publish to Rubygems

In order to publish new version of the gem follow the steps:

  1. git hf release start X.Y.Z
  2. bump up version in RubocopHixonrails::VERSION
  3. git commit -am 'UPD version to X.Y.Z'
  4. git hf release finish X.Y.Z
  5. bundle update rubocop-hixonrails in projects that use it

The gem push script is set up on CircleCI upon git hf release finish, as per Publishing RubyGems using Circle CI 2.0 article.