Gnurr
n. The substance that collects over time in the bottoms of pockets or cuffs of trousers; pocket lint.
Runs ESLint, SCSS-Lint, HAML-Lint, and Rubocop and returns info relevant to changed lines as reported by git.
Installation
As this gem is built to work with your git diffs, it does also require git. If you've managed to execute the above code, you're already there.
Make sure you've installed the Linters you'd like to use.
Add this line to your application's Gemfile:
gem 'gnurr', group: :development, require :false
And then execute:
$ bundle
Or install it yourself as:
$ gem install gnurr
Usage
In Ruby:
gnurr = Gnurr::Processor.new(options)
# Options:
# branch: base branch to diff (default: master)
# linters: which linters to run (default: es,haml,ruby,scss (all))
# verbose: turn on verbose mode
gnurr.execute
In your shell:
$ gnurr --help
Usage: gnurr [options]
    -b, --branch NAME                Base branch: branch to diff against (default: master)
    -l, --linters LIST               Linters to use (default: es,haml,ruby,scss (all))
    -v, --verbose                    Verbose mode (false unless specified)
    -h, --help                       Prints this help
Available Linters
Below are the currently-supported linters. They are not required by this gem and must be independently installed.
- ESLint for JavaScript (requires npm)
- HAML-Lint for HAML
- Rubocop for Ruby
- SCSS-Lint for SCSS
Contributing
- Fork it ( https://github.com/bensaufley/gnurr/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request