Skip to content

Code style checking for GitHub Ruby repositories

License

Notifications You must be signed in to change notification settings

openwurl/wurl-rubocop-style

 
 

Repository files navigation

Wurl Rubocop Style CI

This repository provides recommended RuboCop configuration and additional Cops for use on Wurl open source and internal Ruby projects.

It is a fork and is heavily based on Rubocop Github. If you ever find yourself in a situation where there is something that is not mentioned here, going to the most current Github Rubocop Style Guide for a decision will likely have you doing The Right Thing™.

Usage

Rubocop 0.68 removed performance cops and 0.72 removed Rails cops. However, upgrading rubocop-github without modification will almost definitely create very many new offenses. The current version of this gem exposes the "legacy" configuration under config/default.yml and config/rails.yml which should be used if and only if the version of rubocop is locked to < 0.68 in your project (which it should be unless you bundle update rubocop). It also exposes an "edge" configuration under config/default_edge.yml and config/rails_edge.yml so that the changes can be tested without introducing breaking changes.

Legacy usage

Gemfile

gem "rubocop", "< 0.68"
gem "wurl-rubocop-style"

.rubocop.yml

inherit_gem:
  wurl-rubocop-style:
    - config/default.yml
    - config/rails.yml

Edge usage

Gemfile

gem "wurl-rubocop-style"
gem "rubocop-performance", require: false
gem "rubocop-rails", require: false

.rubocop.yml

inherit_gem:
  wurl-rubocop-style:
    - config/default_edge.yml
    - config/rails_edge.yml

Testing

bundle install bundle exec rake test

The Cops

All cops are located under lib/rubocop/cop/github, and contain examples/documentation.

Using it with editors

You are encouraged to create files describing how you would setup rubocop in-file for the IDE or editor of your choice and adding the files and instructions here:

About

Code style checking for GitHub Ruby repositories

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%