nebulab / erb-formatter

Format ERB files with speed and precision
MIT License
135 stars 22 forks source link

Add a --fail-level check CLI option #52

Closed kochalex closed 2 months ago

kochalex commented 3 months ago

Adds a --fail-level flag with 'check' as the only supported option to have a very basic implementation of what was discussed in #17.

Here's an example of it working:

$ erb-format --fail-level check test/fixtures/attributes.html.erb
<img
  src="image.jpg"
  alt="Responsive Image"
  srcset="image-480w.jpg 480w, image-800w.jpg 800w, image-1200w.jpg 1200w"
  sizes="(max-width: 600px) 480px, (max-width: 1000px) 800px, 1200px"
  data-autocomplete-min-length-value="2"
  data-short-url="//test.com/?q=v"
  data-long-url="https://google.ca/this-is-a-long-url-with-a-query-string?query=something"
  data-long-url-single='https://google.ca/this-is-a-long-url-with-a-query-string?query=something'
>
$ echo $?
1

Fixes #17

elia commented 2 months ago

Thanks, this is great!