Giter Club home page Giter Club logo

ruumba's Introduction

Ruumba

Build Status

.erb or .rb, you're coming with me.

— RuboCop

About

Ruumba is RuboCop's sidekick, allowing you to lint your .erb Rubies as well as your regular-type ones.

Dependencies

  • Ruby 2.2.2+

Installation

λ gem install ruumba

Usage

Command line:

λ ruumba directory_of_erb_files/

Rake task:

require 'ruumba/rake_task'

Ruumba::RakeTask.new(:ruumba) do |t|
  t.dir = %w(lib/views)
end

Then:

λ bundle exec rake ruumba

Fix paths and unapplicable cops

By default, Rubocop only scan .rb files and so does Ruumba. If you want shown paths to reflect original paths, you can add create a .ruumba.yml config file with the following contents:

AllCops:
  Include:
    - '**/*.erb'

You can then disable .rb extension auto-append and use your config file:

λ ruumba -D -e app/views -c .ruumba.yml

Since Ruumba rewrites new files form .erb files contents, some formatting cops cannot apply, you can disable them in your Ruumba file:

Style/FrozenStringLiteralComment:
  Enabled: false
Layout/AlignHash:
  Enabled: false
Layout/AlignParameters:
  Enabled: false
Layout/IndentationWidth:
  Enabled: false
Layout/TrailingBlankLines:
  Enabled: false

You can use ruumba -a or ruumba -D to look for other cops if this list is missing some.

You might want to include your existing rubocop config file by appending this in front of your Ruumba config:

inherit_from: .rubocop.yml

Contributing

  1. Branch (git checkout -b fancy-new-feature)
  2. Commit (git commit -m "Fanciness!")
  3. Test (bundle exec rake spec)
  4. Lint (bundle exec rake rubocop)
  5. Push (git push origin fancy-new-feature)
  6. Ye Olde Pulle Requeste

ruumba's People

Contributors

aclemons avatar derjanb avatar ericqweinstein avatar

Watchers

 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.