armitage-rubocop · Gem Version


Configured rules:

  • Common (.rubocop.general.yml) (.rubocop.rails.yml) (.rubocop.rake.yml)
    • Bundler
    • Rake
    • Gemspec
    • Layout
    • Lint
    • Metrics
    • Migration
    • Naming
    • Performance
    • Rails (isn't included in .rubocop.general.yml)
    • Security
    • Style
    • Rake (isn't included in .rubocop.general.yml)
  • RSpec (.rubocop.rspec.yml) (.rubocop.rails.yml)
    • Capybara
    • FactoryBot
    • Rails
    • RSpec

Installation

gem 'armitage-rubocop'
$ bundle install
# --- or ---
$ gem install 'armitage-rubocop'
require 'armitage-rubocop'

Usage

  • edit your .rubocop.yml file:
# --- vanilla ---
inherit_gem:
  armitage-rubocop:
    - lib/rubocop.general.yml
    - lib/rubocop.rspec.yml
    - lib/rubocop.rake.yml
# --- rails ---
inherit_gem:
  # rails-specific cops + general + rspec
  armitage-rubocop: lib/rubocop.rails.yml

Build

# --- full build ---
bundle exec rake armitage_rubocop:build

# --- validate code style ---
bundle exec rake rubocop

# --- validate yaml files ---
bundle exec rake armitage_rubocop:validation:valid_yamls

# --- validate rubocop cops (existence and params) ---
bundle exec rake armitage_rubocop:validation:recognizable_cops