w3c / epubcheck

The conformance checker for EPUB publications
https://www.w3.org/publishing/epubcheck/
BSD 3-Clause "New" or "Revised" License
1.64k stars 402 forks source link

Parameter to suppress specific errors #1573

Open benhbell opened 2 weeks ago

benhbell commented 2 weeks ago

We have an online reader that makes use of a LOT epub technology, but our tooling requires that we break 1 or two aspects of the spec. Our epubs are not available or usable in other readers, but we do want to make sure that they are as "valid" as possible to keep things clean.

Is there an argument or way to give epubcheck a list of error codes that it should ignore?

mattgarrish commented 2 weeks ago

You should be able to change the severity level of messages using the -c option and a custom message file. That would let you push errors down to usage messages, for example, which would prevent them from being output by default.

benhbell commented 2 weeks ago

I was exploring this, but doesn't error level changing clear all levels of that category?

the -c option might be it. I might just not be reading the docs correctly - https://www.w3.org/publishing/epubcheck/docs/cli/#options but I cannot find an example of the file format to override the messages of two specific error codes.

mattgarrish commented 2 weeks ago

but doesn't error level changing clear all levels of that category?

Depends on what you mean by category. Some message codes are catch-alls, in which case you would change the severity of everything caught by the code. But you should be able to change individual codes within a class of messages without affecting the others.

I cannot find an example of the file format to override the messages of two specific error codes.

Ya, I don't think it's been documented. @rdeltour gave some info on how to use it in https://github.com/w3c/epubcheck/issues/1343 including how to suppress messages.

I just gave that a try and it didn't seem to do anything for me, though. Hopefully, the option is still working.

benhbell commented 1 week ago

Thanks, that got me a lot closer. Unfortunately for me, one of the errors we have is an RSC-005, but I don't want to suppress them all. Was hoping that the custom message could also map to the error message, AKA Error while parsing file: value of attribute "width" is invalid; must be an integer

Thank you for pointing me in the right direction.