Pronto-Herb
A Pronto runner for Herb, the HTML-aware ERB linter. Enables ERB template linting in pull request reviews.
Installation
Add this line to your application's Gemfile:
gem 'pronto-herb'And then execute:
bundle installOr install it yourself as:
gem install pronto-herbPrerequisites
Pronto-Herb uses the npm package @herb-tools/linter. Make sure it's available in your project:
npm install --save-dev @herb-tools/linter
# or
yarn add --dev @herb-tools/linterUsage
Once installed, Pronto will automatically use pronto-herb when running on repositories with ERB files.
# Run on staged changes
pronto run --staged
# Run on a specific commit range
pronto run --commit origin/main
# Run on GitHub pull request
pronto run -f github_status github_pr_reviewSupported File Extensions
.erb.html.erb.rhtml
Configuration
You can customize severity mappings in your .pronto.yml:
herb:
severities:
error: error
warning: warning
info: info
hint: infoSeverity Mapping
| Herb Level | Default Pronto Level |
|---|---|
| error | :error |
| warning | :warning |
| info | :info |
| hint | :info |
Development
After checking out the repo, run bundle install to install dependencies. Then, run bundle exec rake test to run the tests.
To install this gem onto your local machine, run bundle exec rake install.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/NotGrm/pronto-herb.
License
The gem is available as open source under the terms of the MIT License.