The rubocop-squad gem provides a robust Rubocop configuration for
Ruby development. It defines a set of rules in its .rubocop.yml and
wraps its dependencies, other Rubocop gems, into a single package.
rubocop-squad contains these cops:
rubocop-fakerrubocop-ordered_methodsrubocop-performancerubocop-railsrubocop-rakerubocop-rspecrubocop-thread_safety
You can review the baseline configuration in this gem's .rubocop.yml file.
Installation in any Ruby project is a snap. You can add
the rubocop-squad Rubocop configuration and its tools with
three lines of code.
First, add this line to your application's Gemfile...
gem 'rubocop-squad', git: 'https://github.com/martinstreicher/rubocop-squad', branch: 'main'... and then execute bundle in the shell:
bundle installNext, create the file .rubocop.yml in your project root directory and add this content:
inherit_gem:
rubocop-squad: .rubocop.ymlRubocop configurations added via inherit_gem are prepended to the inherit_from
directive. inherit_gem configurations are loaded first, followed by inherit_from
(overriding the configurations from the gems). The remaining directives in the
configuration file supersede any of the inherited configurations. (This means the
configurations inherited from one or more gems have the lowest precedence of inheritance.)
To find and fix Rubocop violations in your code, run rubocop -A in your shell:
rubocop -AAfter checking out the repo, run bin/setup to install dependencies.
To install this gem onto your local machine, run bundle exec rake install.
To release a new version of this gem, update the version number in version.rb and run bundle exec rake release
to create a git tag for the version and push all commits and tags to origin.
Bug reports and pull requests are welcome on GitHub at https://github.com/martinstreicher/rubocop-squad.
The gem is available as open source under the terms of the MIT License.