RuboCop Cop for Elegant Ruby Code

EO principles respected here DevOps By Rultor.com We recommend RubyMine

rake Gem Version Yard Docs License Test Coverage Hits-of-Code

This is a RuboCop plugin that enforces Elegant Objects principles in Ruby code. Default RuboCop configuration is too permissive, allowing coding practices that lead to unmaintainable code: comments that lie, verbose methods, cryptic variable names, and so on. This plugin configures existing RuboCop cops with stricter settings and adds custom cops for rules that RuboCop doesn't provide out of the box.

First, install it:

gem install rubocop-elegant

Then, format your .rubocop.yml like this:

AllCops:
  EnabledByDefault: true
  NewCops: enable
plugins:
  - rubocop-minitest
  - rubocop-performance
  - rubocop-rake
  - rubocop-elegant # must be the last one

The rubocop-elegant not only provides its own cops, but also configures default ones the "right" way.

How to contribute

Read these guidelines. Make sure your build is green before you contribute your pull request. You will need to have Ruby 2.3+ and Bundler installed. Then:

bundle update
bundle exec rake

If it's clean and you don't see any error messages, submit your pull request.