Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--failure-level ERROR argument does not work #613

Open
siaccarino opened this issue Feb 2, 2022 · 3 comments
Open

--failure-level ERROR argument does not work #613

siaccarino opened this issue Feb 2, 2022 · 3 comments

Comments

@siaccarino
Copy link
Contributor

Hello,

Expected:

--failure-level argument behaves like in Asciidoctor.js

Observed:

--failure-level ERROR does NOT lead to an exit code != 0 even on build errors

Version:

Asciidoctor Web PDF 1.0.0-alpha.14 using Asciidoctor.js 2.2.6 (Asciidoctor 2.0.17) [https://asciidoctor.org]

Ninja build log with asciidoctor-web-pdf :

[build] [1/1 100% :: 5.820] cd release_plan && asciidoctor-web-pdf index_pdf.adoc --failure-level ERROR -r asciidoctor-kroki -a stylesheet="+/shared_parts/styles_pdf.css,/shared_parts/styles_common.css" -a webfonts! -D release_plan -o release_plan.pdf
[build] asciidoctor: ERROR: revisions.adoc: line 8: include file not found: revisions/r_0_1_0.adoc
[build] Build finished with exit code 0

Ninja build log with asciidoctor.js:

[build] [1/1 100% :: 0.575] cd release_plan && asciidoctor index.adoc -r asciidoctor-kroki -D build -b xhtml5 -a webfonts! -a linkcss -a copycss --failure-level ERROR
[build] FAILED: build/index.html
[build] cd release_plan && asciidoctor index.adoc -r asciidoctor-kroki -D build -b xhtml5 -a webfonts! -a linkcss -a copycss --failure-level ERROR
[build] asciidoctor: ERROR: revisions.adoc: line 8: include file not found: revisions/r_0_1_0.adoc
[build] ninja: build stopped: subcommand failed.
[build] Build finished with exit code 1

@siaccarino
Copy link
Contributor Author

siaccarino commented Feb 4, 2022

blob@babble:~/xyz$ asciidoctor-web-pdf --help
asciidoctor-web-pdf [files...]

Options:
  ... cut come lines ...
      --failure-level     set minimum logging level that triggers non-zero exit code
  [choices: "info", "INFO", "warn", "WARN", "warning", "WARNING", "error", "ERROR", "fatal", "FATAL"] [default: "FATAL"]

Why is it an improvement if a function that is show in help works as expected? I don't want to make pressure - just want to understand - if the help does not tell the truth what else is not there?

@ggrossetie
Copy link
Owner

Asciidoctor Web PDF inherits from the Asciidoctor CLI (https://github.com/asciidoctor/asciidoctor-cli.js) mainly to avoid duplication but this feature is not implemented/supported.

Arguably it could be a "bug" but I don't know how to implement it that's why I'lm using "improvement" because we need to define the behavior of this option in this context.

I could also treat it as a bug and remove the option from the --help (since it's not supported and I don't know how to support it) but I don't think that's what you are asking 😉

@siaccarino
Copy link
Contributor Author

Thanks, what about cherry-picking the failure-level implementation revision from asciidoc.js so that at least the asciidoc rendering part is covered?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants