Questions on command-line options in 4.x
brockfanning opened this issue · comments
Would it be possible point me to any documentation of the changes to the command-line options from 3.x to 4.x? From what I can gather:
--check-html
is no longer a valid option. I'm guessing it is the default now?--url-ignore
is now--ignore-urls
?--file-ignore
is now--ignore-files
?
In particular regards to --ignore-files
, have its requirements changed? It doesn't seem to be working the same way it did in 3.x. In my case, I'm running something like this:
#!/bin/bash
set -o errexit
set -o pipefail
set -o nounset
IGNORE_HREFS=$(ruby -e 'puts %w{
\/my-ignored-url
\/my-other-ignored-url
}.map{|h| "/#{h}/"}.join(",")')
bundle exec htmlproofer _site --disable-external --ignore-files $(paste -sd, .htmlprooferignore) --ignore-urls $IGNORE_HREFS $@
Where .htmlprooferignore
is a file like this:
_site/a-file-i-want-to-ignore.html
_site/other-file-i-want-to-ignore.html
But it's not ignoring the files. Previously with html-proofer 3.x, it was working correctly using this command:
bundle exec htmlproofer _site --check-html --disable-external --file-ignore $(paste -sd, .htmlprooferignore) --url-ignore $IGNORE_HREFS $@
Thanks for any advice!
@brockfanning, https://github.com/gjtorikian/html-proofer/blob/main/UPGRADING.md should be the main pointer here.
Also be aware of the fact that "boolean" options like --disable-external
must be specified as --disable-external=true
(or --disable-external=false
). See also #748 (comment) for some more reference
@riccardoporreca Perfect, thanks very much!
I'm not sure why our custom "htmlprooferignore" is not working anymore, but I will investigate more.
--check-html is no longer a valid option. I'm guessing it is the default now?
At the risk of inducing future ire, check-html
was always very broken (HTML can be malformed in all sorts of ways), and it was removed to spare the poor heart of the maintainer tracking down each and every minor quirk that came up.