Skip to content

Default Rubocop rules used in Cobalt rails projects

License

Notifications You must be signed in to change notification settings

cobalthq/cobalt-rubocop

Repository files navigation

Cobalt RuboCop

Gem Version GitHub License Gem Downloads Ruby Style Guide

Description

This repository provides recommended linting rules for Ruby repositories.

Contributing

If you wish to contribute, please check our guidelines in CONTRIBUTING.md

Who to ask for help

Ask the CODEOWNERS

Installation

Gemfile

Add

source 'https://rubygems.pkg.github.com/cobalthq' do
  group :development do
    gem 'cobalt-rubocop', require: false
  end
end

Remove

gem 'rubocop', require: false
gem 'rubocop-performance', require: false
gem 'rubocop-rails', require: false
gem 'rubocop-rspec', require: false

Specific versions installed for:

.rubocop.yml

Configuration Options:

inherit_gem:
  cobalt-rubocop:
    - "config/default.yml"
    - "config/rails.yml"
    - "config/rspec.yml"

Usage

bundle install
bundle exec rubocop

When installing rules on an older project it is possible to generate a todo list:

bundle exec rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 40000

The number of offences can be counted:

grep "Offense count" .rubocop_todo.yml | awk -F: '{sum+=$2} END {print sum}'

About

Default Rubocop rules used in Cobalt rails projects

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages