Inspire's Ruby Style¶ ↑
This gem packages [Inspire]'s [Rubocop] configuration so that it can easily be used in multiple projects. Projects can inherit the global configuration, and easily add or overwrite rules as necessary.
The gem additionally declares Rubocop as a dependency. Since different versions of Rubocop have different default rules, it is important to run the same version in all projects to achieve the same Ruby style. Nonetheless, projects can opt-in to newer Rubocop versions by adding Rubocop as a dependency in their Gemfile
with the newer version.
Installation¶ ↑
Add this line to your application's Gemfile:
gem "inspire-ruby-style", github: "inspirenl/inspire-ruby-style", tag: "v4"
And then execute:
$ bundle
Or install it yourself as:
$ gem install inspire-ruby-style
Usage¶ ↑
After installing the gem, create a .rubocop.yml
file in the project root with the following contents:
inherit_gem: inspire-ruby-style: - default.yml
Individual rules can be overwritten for each project as needed. For example, it might make sense to disable the Rails rules for gems:
Rails: Enabled: false
Releases¶ ↑
This gem does not follow SemVer, since any change to the style guide must be considered a breaking change. When making any changes to the style guide, increase the version number in the gemspec
.
Document all changes in the CHANGELOG
, so that it is easy to check if specific rules need to be overwritten in a projec.t When changes to the guide are merged into master
, create a new release on GitHub and tag it with the new version number.
License¶ ↑
The gem is available as open source under the terms of the MIT License.