Sensible default for RuboCop.
The purpose of this tiny gem is to be useless at all.
No, seriously. This gem adds serveral congigurations for RuboCop that I think are sensible and that's it. If RuboCop's default will be changed in the future, it's useless anymore.
It overrides the following configurations.
It increases the default value to 20
. It can be lower, but 20 seems pretty reasonable from my experience. Send a Pull Request if you have a different opinion.
It can be disabled at all, but for now it's 160
. 160
comes from my experience that code which is longer than 160 characters tends to have some problem.
When the team is not international, we'd like to write comments in our own language.
Double negation is used so widely that it doesn't make sense to disable it by default.
This is a little controversial but using styles like [:create, :edit]
makes sense.
Add this line to your application's Gemfile:
gem 'rubocop-sensible', group: :development, require: false
And then execute:
$ bundle
Add the code snippet below to your .rubocop.yml
inherit_gem:
rubocop-sensible:
- "config/rubocop.yml"
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/okuramasafumi/rubocop-sensible. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the rubocop-sensible project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.