Custom RuboCop plugin enforcing personal Ruby on Rails style and conventions.
Add the gem to your Rails application's Gemfile:
group :development, :test do
gem "mecha_style-rails", github: "jefflunt/mecha_style-rails", require: false
endEnable the plugin in .rubocop.yml:
plugins:
- rubocop-rails
- mecha_style-rails- Create a cop class in
lib/rubocop/cop/mecha_style_rails/<cop_name>.rbunderRuboCop::Cop::MechaStyleRails(all files in that directory are auto-required). - Add its default configuration entry in
config/default.yml. - Add specs in
spec/rubocop/cop/mecha_style_rails/<cop_name>_spec.rb.
You can also place personal overrides for built-in Style/*, Layout/*, Lint/*, or Rails/* cops directly in config/default.yml.
bin/setup
bundle exec rake # runs RSpec and RuboCop
bundle exec rspec # runs cop specs only
bundle exec rubocop # lints this repository