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
Filtering validation error messages for CI process #391
Comments
There is is not yet a built-in or maintainable way to filter a list of specific errors to ignore. We would welcome a patch for one. Other projects have dealt with the deficiency by adding their own filtering mechanisms. See for example the code that the (Java) If your implementation is in Java, @cvrebert ( |
I have a working filter based on a copy of MessageEmitterAdapter (cannot extend a final class), with a call to a filtering discriminator "isAllowed()" in methods warning() and error(). A JSON persisted configuration class is used to load ignored error and warning messages, which has a "debug" flag that ignores everything and prints a uniquely sorted list of all the errors encountered-- potentially to add some of them to the "ignored" list. Everything is chained through a Selenium and ChromeDriver browser test framework. There are two problems so far: 1) Testing is difficult (changed a number of private methods to public to unit test), and 2) method MessageEmitterAdapter.elaboration(Exception e) has some dead code due to two cases testing for "if (e instanceof StringNotAllowedException)" I will try to post the suggested changes soon. |
Thanks for the update—sounds like good progress |
This change adds a new `filterpattern` param to the Web checker and network API. Use the `filterpattern` param to filter out (drop/ignore/suppress) errors and warnings you don’t care about/don’t want to see/don’t consider to be a problem. The `filterpattern` value must be a (percent-encoded) regex. Any error/warning messages matching the regex will be filtered out (dropped/ignored/suppressed). A similar option will also be added to the vnu.jar command-line checker soon. Relates to #391
Given that the checker does now have a message-filtering feature and it’s documented at https://github.com/validator/validator/wiki/Message-filtering, I’m gonna go ahead and close this out. But feel free to comment here if any clarification is needed |
For a continuous integration build process, I am using validator as a library called by an automated test framework. The validation is intended to screen for high-risk errors, and needs to ignore many others.
Is there a built-in or maintainable way to filter a list of specific errors to ignore?
The text was updated successfully, but these errors were encountered: