Skip to content
This repository has been archived by the owner on Dec 20, 2022. It is now read-only.

stampedai/rubocop-stamped

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RuboCop Stamped

RuboCop configuration for use on Stamped open source and internal Ruby projects.

Installation

Gemfile

group :development, :test do
  gem "rubocop-stamped", require: false
  gem "rubocop-rails", require: false # Optional
end

.rubocop.yml

inherit_gem:
  rubocop-stamped:
    - config/default.yml
    - config/rails.yml # Optional

Usage

Generate a RuboCop configuration:

rubocop --auto-gen-config

See:

Automatically correct offenses:

rubocop --auto-correct
rubocop --safe-auto-correct

See:

Style

We mostly rely on standard for default styles, but we're also taking inspiration from these styleguides:

All the choices below are specific to Stamped:

Layout

  • Limit lines to 120 characters (Shopify)
  • Use spaces around operators, after commas, colons and semicolons, around { and before } (Shopify)

Style

  • Usage of trailing comma in multi-line collection literals is encouraged. It makes diffs smaller and more meaningful. (Shopify)
# not encouraged
{
  foo: :bar,
  baz: :toto
}

# encouraged
{
  foo: :bar,
  baz: :toto,
}

What's included

Default

inherit_gem:
  rubocop-stamped:
    - config/default.yml

Includes cops for:

Rails

inherit_gem:
  rubocop-stamped:
    - config/rails.yml

Includes cops for:

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/stampedai/rubocop-stamped. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

MIT