Giter VIP home page Giter VIP logo

g5-rubocop-style's Introduction

G5 Rubocop Style

G5 shared rubocop style configs.

Installation

Add this line to your application's Gemfile:

group :test, :development do
  gem 'g5-rubocop-style', '~> 1.2.0', source: 'https://gem.fury.io/g5dev/'
end

Or, for a Ruby library, add this to your gemspec:

spec.add_development_dependency 'g5-rubocop-style'

And then run:

$ bundle install

Usage

Create a .rubocop.yml with one of the following directives:

inherit_gem:
  g5-rubocop-style:
    - default.yml

Or, if your repo requires codeclimate read the next section

Now, run:

$ bundle exec rubocop --auto-correct  // Auto-correct offenses (only when safe)

and

$ bundle exec rubocop --auto-gen-config // Generate a configuration file acting as a TODO list.

Also, consider integrating rubocop with your editor or to a post commit git hook. https://docs.rubocop.org/rubocop/integration_with_other_tools.html

You do not need to include rubocop directly in your application's dependencies. G5 Rubocop Style will include a specific version of rubocop and rubocop-rspec that is shared across all projects.

CodeClimate

If you need to use CodeClimate to help test your code you will need to use an http/https url instead of a gem, so use this snippet as your .rubocop.yml.

## .rubocop.yml

inherit_from:
  - https://raw.githubusercontent.com/g5search/g5-rubocop-style/v1.2.0/default.yml

For codeclimate to download the file you need to add these lines to the .codeclimate.yml file on the root of your project

# .codeclimate.yml

version: "2"

prepare:
  fetch:
    - url: https://raw.githubusercontent.com/g5search/g5-rubocop-style/v1.2.0/default.yml
      path: .rubocop-https---raw-githubusercontent-com-g5search-g5-rubocop-style-v1-2-0-default-yml
      
plugins:
  rubocop:
    enabled: true
    channel: "rubocop-1-9-1"

Because of this rubocop will download a .rubocop-https---raw-githubusercontent-com-g5search-g5-rubocop-style-v1-2-0-default-yml to your project, so add it to your .gitignore file so it does not get deployed

## .gitignore

.rubocop-http*

As G5 releases new versions of this gem you will need to change the v1.2.0 to the current version.

inherit_from order

Rubocop takes into account the order of the inherit_from keys, so if you are adding a .rubocop_todo.yml it should go after the https://raw.githu.... like this:

## .rubocop.yml

inherit_from:
  - https://raw.githubusercontent.com/g5search/g5-rubocop-style/v1.2.0/default.yml
  - .rubocop_todo.yml

g5-rubocop-style's People

Contributors

levibrown avatar

Watchers

Saul Martínez avatar  avatar Davi Thiesse avatar Rodrigo Ulisses e Silva avatar Matt Bohme avatar  avatar Chris Eckert avatar g5dev avatar James Cloos avatar Lance Vincent Bumanglag avatar  avatar Mark Bluhm avatar Jeff avatar Kevin Hernandez Jimenez avatar Ítalo Pires avatar Felipe Nolleto Nascimento avatar  avatar Jorge David C.T Junior avatar Ramon William avatar Gustavo Pessacq avatar Randy Leighton avatar Bryan Argandona avatar Rodrigo Boniatti avatar Kyle Rose avatar Rafael Carvalho avatar Jazo Madrid avatar Jose V avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.