quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.96k stars 326 forks source link

`quarto-render --fail-if-warnings` not working as expected #493

Open johnkerl opened 2 years ago

johnkerl commented 2 years ago

I want things like misspelled filenames to trigger an error, especially in a CI job (which is awesome BTW https://github.com/quarto-dev/quarto-cli/discussions/439).

However, I don't get the non-zero exit code I would expect:

$ quarto render --fail-if-warnings
[ 1/14] file1.md
[ 2/14] file2.md
...
WARNING: Unable to resolve link target: intentional-typo.md
...
[13/14] file13.md
[14/14] file14.md

Output created: docs/index.html

$ echo $?
0

$ quarto --version
0.9.171
jjallaire commented 2 years ago

This setting is currently only passed through to pandoc (so pandoc warnings will yield the expected exit code). We'll plan on doing the same for Quarto warnings (leaving this open as we aren't working on this right away).

dgkf commented 9 months ago

I was looking for this as well. Instead of failing, I was actually looking for a non-0 exit code.

In CI, it would be nice if the rendering didn't immediately fail, but rather render to completion so that things like faulty link URLs can all be addressed in batch. If the exit status was used to indicate the most severe log level, then it would be easy enough to tailor some CI behavior from there.