Skip to content

Commit

Permalink
Warning is not a reason to fail
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Škoda <skodapetr@gmail.com>

#13
  • Loading branch information
skodapetr committed May 13, 2024
1 parent 94c9024 commit c69942e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import cz.mvcr.datavalidator.cli.writer.StdOutReportWriter;
import cz.mvcr.datavalidator.core.FileReport;
import cz.mvcr.datavalidator.core.Report;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.DefaultParser;
Expand Down Expand Up @@ -60,7 +61,7 @@ protected int run(String[] args) {
}
LOG.debug("Validation completed.");
(new StdOutReportWriter()).writeReports(reports);
return !reports.isEmpty() ? 1 : 0;
return reports.stream().noneMatch(item -> item.type == Report.Type.ERROR) ? 0 : 1;
}

private void setUtf8OutputEncoding() {
Expand Down

0 comments on commit c69942e

Please sign in to comment.