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:
# base: Base reference: branch, SHA, etc for diff (default: master)
# expanded: Show lints for all changed files, not just changed lines
# (false unless specified)
# linters: Linters to use (default: es,haml,ruby,scss (all))
# verbose: turn on verbose mode
gnurr.execute
In your shell:
$ gnurr --help
Usage: gnurr [options]
-b, --base NAME Base reference: branch, SHA, etc for diff (default: master)
-e, --expanded Show lints for all changed files, not just changed lines (false
unless specified)
-l, --linters LIST Linters to use (default: es,haml,ruby,scss (all))
-v, --[no-]verbose Run verbosely
--version Show version
-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 (~> 0.16.1) for HAML
- Rubocop (~> 0.47.0) for Ruby
- SCSS-Lint (~> 0.37.2) 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