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

Simplify filtering of validation report files #306

Closed
javagl opened this issue Apr 5, 2024 · 0 comments · Fixed by #307
Closed

Simplify filtering of validation report files #306

javagl opened this issue Apr 5, 2024 · 0 comments · Fixed by #307

Comments

@javagl
Copy link
Contributor

javagl commented Apr 5, 2024

Right now, the validator can write the validation result as JSON to an output file, using the --reportFile command line argument.

When used programmatically (as a library), it offers a certain filter functionality, like

  const filteredResult = result
    .filter(ValidationIssueFilters.byIncludedSeverities(ValidationIssueSeverity.ERROR));

to only keep validation errors.

But there is no easy way to apply these filters to a report file that has been written: The ValidationResult class is a real class, and cannot be constructed with JSON.parse.

There should be a helper function for this, to create a ValidationResult from a report file, and filter it post-hoc.

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

Successfully merging a pull request may close this issue.

1 participant