RuboCop::Packaging is an extension of RuboCop,
which is a Ruby static code analyzer (a.k.a. linter) and code formatter.
It helps enforcing some of the guidelines that are expected of upstream maintainers so that the downstream can build their packages in a clean environment without any problems.
A detailed documentation, explaining what this extension is doing and the reasoning behind it, can be found here: https://docs.rubocop.org/rubocop-packaging/
We also have a packaging-style-guide, listing some good and bad examples and the rationale behind these cops.
In case anything is not clear, please feel free to raise an issue, asking for more explanation!
Add this line to your application's Gemfile:
gem 'rubocop-packaging'And then execute:
$ bundle installOr install it yourself as:
$ gem install rubocop-packagingYou need to tell RuboCop to load the Packaging extension. There are three ways to do this:
Put this into your .rubocop.yml file:
plugins: rubocop-packagingAlternatively, use the following array notation when specifying multiple extensions:
plugins:
- rubocop-other-extension
- rubocop-packagingNow you can run rubocop and it will automatically load the RuboCop Packaging
cops together with the standard cops.
Note
The plugin system is supported in RuboCop 1.72+. In earlier versions, use require instead of plugins.
rubocop --plugin rubocop-packagingRuboCop::RakeTask.new do |task|
task.plugins << 'rubocop-packaging'
endAfter 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.
As always, bug reports and pull requests are heartily welcomed! 💖 This project is intended to be a safe and welcoming space for collaboration.
rubocop-packaging is available as open-source under the
MIT License.