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
This gem is not yet hosted elsewhere. To install, clone the repo, then
cd into that directory and build the gem.
$ git clone https://github.com/bensaufley/gnurr
$ bundle install
…
$ rake install
If you intend to use ESLint, be sure to install that in npm. The other linters – HAML-Lint, Rubocop, and SCSS-Lint – are all listed as gem dependencies.
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.
Eventually, you'll be able to:
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
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