This repository provides recommended linting rules for Ruby repositories.
If you wish to contribute, please check our guidelines in CONTRIBUTING.md
Ask the CODEOWNERS
source 'https://rubygems.pkg.github.com/cobalthq' do
group :development do
gem 'cobalt-rubocop', require: false
end
end
gem 'rubocop', require: false
gem 'rubocop-performance', require: false
gem 'rubocop-rails', require: false
gem 'rubocop-rspec', require: false
Specific versions installed for:
Configuration Options:
inherit_gem:
cobalt-rubocop:
- "config/default.yml"
- "config/rails.yml"
- "config/rspec.yml"
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}'