Rubocop::Replaypoker
Common Ruby style settings. This gem takes all the settings and version controls still giving to the developer the ability to make per project adjustments.
Installation
Add this line to your application's Gemfile:
gem 'rubocop-replaypoker', require: false
And then execute:
$ bundle install
Or install it yourself as:
$ gem install rubocop-replaypoker
Usage
This gem assume that it will be used in the project with the linter settings inheritance would be something like this:
- Rubocop gem defaults, link
- The settings from this gem, link
- The auto-gen-config (see in your project
.rubocop_todo.yml
)- This file is auto generated by rubocop with the command
bundler exec rubocop --auto-gen-config
and stub all the warnings from rubocop. - Keep this file empty in the
master
branch
- This file is auto generated by rubocop with the command
- Project specific settings (see in your project
.rubocop_local_overrides.yml
)- rubocop gem have the variety of extra addons which might be added and require some extra settings or the project might require some adjustments against the already defined settings. All of it should be in here.
To apply this structure copy link to your project root.
Notes && gotchas
- Rubocop gem have an awesome auto-correction feature. There are 2 modes: safe & ricky. To run safe option use
bundle exec rubocop -a
and for ricky usebundle exec rubocop -A
. - Some rubocop cops depend on the settings from another cops (
Layout/LineLength
cop is a great example), so if you added some code which break this cop and there is no way to auto-correct it and then executedbundler exec rubocop auto-gen-config
it produce the new copMax
setting and it would be applied all the dependencies. It might produce a lot of unwanted changes. - Because of the previous trait i recommend to
git commit
all your changes and run rubocop afterwards, and then apply the changes with something likegit add . && git commit --amend --no-edit
Development
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.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/replaypoker/rubocop-replaypoker. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the Rubocop::Replaypoker project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.