Repository is archived
No release in over a year
Ruby style guide info for BOXT projects, as well as config settings for Rubocop
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

BOXT Ruby Style Guide

This repo is now archived in favour of https://github.com/boxt/boxt_rubocop.

Gem Version CI

Ruby style guide and base Rubocop settings for Boxt Ruby projects.

For the most part we are using this Ruby style guide as the base guide, with any deviations can be found in the default.yml.

Requirements

  • Ruby 3.0

Installation

Add this line to your application's Gemfile:

group :development, :test do
  # ...
  gem "boxt_ruby_style_guide"
end

And then execute:

bundle

Usage

Add a .rubocop.yml file to the root of your project with the following settings:

inherit_gem:
  boxt_ruby_style_guide:
    - default.yml # use default cops
    - rails.yml # use Rails cops - see Additional Extensions/Cops
    - rspec.yml # use rspec cops - see Additional Extensions/Cops

NewCops

NewCops is enabled by default.

Additional Extensions/Cops

The following Rubocop gems are also installed with this gem:

To enable add the following to your .rubocop.yml file.

inherit_gem:
  boxt_ruby_style_guide:
  # .... add cops

require:
  - rubocop-faker # if your project is using the Faker gem then add this
  - rubocop-rails # if your project is a Rails app/engine then add this, plus the - rails.yml setting above
  - rubocop-rake # if your project is using rake then add this
  - rubocop-rspec # if your project is using rspec then add this, plus the - rspec.yml setting above

Editor Plugins

There are also some useful Rubocop editor plugins to help with in-editor linting.

Atom

RubyMine

VSCode

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/boxt/ruby_style_guide.

License

The gem is available as open source under the terms of the MIT License.