Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
voxpupuli-rubocop/README.txt
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
57 lines (43 sloc)
2.08 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Vox Pupuli RuboCop Gem | |
| [](https://github.com/voxpupuli/voxpupuli-rubocop/blob/master/LICENSE) | |
| [](https://github.com/voxpupuli/voxpupuli-rubocop/actions/workflows/ci.yml) | |
| [](https://github.com/voxpupuli/voxpupuli-rubocop/actions/workflows/release.yml) | |
| [](https://rubygems.org/gems/voxpupuli-rubocop) | |
| [](https://rubygems.org/gems/voxpupuli-rubocop) | |
| This is one of the Vox Pupuli meta gems. It provides a convenient way to | |
| configure [RuboCop](https://rubocop.org/). RuboCop is the de facto standard Ruby | |
| Linter and Formatter. `voxpupuli-rubocop` depends on the correct RuboCop version | |
| + dependencies that we want to use in our CI pipelines. There is also a | |
| [rubocop.yml](rubocop.yml) that configures RuboCop. and preconfigured rake | |
| tasks. | |
| The goal of this gem is to provide a central configuration for RuboCop that's | |
| used in all Vox Pupuli gems. | |
| ## Usage | |
| In your Gemfile, add the following: | |
| ``` | |
| gem 'voxpupuli-rubocop', '~> 1.0' | |
| ``` | |
| In your Rakefile, include our Rake task: | |
| ``` | |
| require 'voxpupuli/rubocop/rake' | |
| ``` | |
| Now you can list your rake tasks and should see three new ones: | |
| ```terminal | |
| bundle exec rake -T | |
| rake rubocop # Run RuboCop | |
| rake rubocop:autocorrect # Autocorrect RuboCop offenses (only when it's safe) | |
| rake rubocop:autocorrect_all # Autocorrect RuboCop offenses (safe and unsafe) | |
| ``` | |
| To use our default config, create a `.rubocop.yml`: | |
| ``` | |
| --- | |
| inherit_gem: | |
| beaker: rubocop.yml | |
| ``` | |
| You maybe see a bunch of violations with the new configuration. A common path | |
| forward is to accept them but prevent future/more violations. You can generate | |
| a "RuboCop ToDo file", which is basically an allow-list of all current | |
| violations: | |
| ``` | |
| bundle exec rubocop --regenerate-todo | |
| ``` |