diff --git a/.github/workflows/zerocracy.yml b/.github/workflows/zerocracy.yml index c1e86fdfd9..6a3ac9ed78 100644 --- a/.github/workflows/zerocracy.yml +++ b/.github/workflows/zerocracy.yml @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - - uses: zerocracy/judges-action@0.0.52 + - uses: zerocracy/judges-action@0.0.53 with: token: ${{ secrets.ZEROCRACY_TOKEN }} options: | @@ -40,7 +40,7 @@ jobs: vitals_url=https://www.eolang.org/zerocracy/objectionary-vitals.html repositories=objectionary/* factbase: objectionary.fb - - uses: zerocracy/pages-action@0.0.34 + - uses: zerocracy/pages-action@0.0.35 with: factbase: objectionary.fb output: pages diff --git a/eo-maven-plugin/src/it/rewritten_sources/pom.xml b/eo-maven-plugin/src/it/rewritten_sources/pom.xml index 6196aee784..228fa8d9e5 100644 --- a/eo-maven-plugin/src/it/rewritten_sources/pom.xml +++ b/eo-maven-plugin/src/it/rewritten_sources/pom.xml @@ -41,13 +41,13 @@ SOFTWARE. org.junit.jupiter junit-jupiter-api - 5.10.3 + 5.11.1 test org.junit.jupiter junit-jupiter-params - 5.10.3 + 5.11.1 test diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/UnphiMojo.java b/eo-maven-plugin/src/main/java/org/eolang/maven/UnphiMojo.java index 494a5a3221..404014f3be 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/UnphiMojo.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/UnphiMojo.java @@ -30,7 +30,6 @@ import java.io.File; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.Arrays; import java.util.List; import java.util.Set; import org.apache.maven.plugins.annotations.LifecyclePhase; @@ -104,7 +103,7 @@ public final class UnphiMojo extends SafeMojo { @Override public void exec() { - final List errors = new ListOf<>(); + final List errors = new ListOf<>(); final Home home = new HmBase(this.unphiOutputDir); final Iterable metas = new UnphiMojo.Metas(this.unphiMetas); final int count = new SumOf( @@ -119,7 +118,7 @@ public void exec() { String.format(".%s", TranspileMojo.EXT) ) ); - final XML result = TRANSFORMATIONS.pass( + final XML result = UnphiMojo.TRANSFORMATIONS.pass( new PhiSyntax( phi.getFileName().toString().replace(".phi", ""), new TextOf(phi), @@ -133,7 +132,13 @@ public void exec() { phi, this.unphiOutputDir.toPath().resolve(xmir) ); if (result.nodes("//errors[count(error)=0]").isEmpty()) { - errors.add(relative); + errors.add( + String.format( + "%s:\n\t%s\n", + relative, + String.join("\n\t", result.xpath("//errors/error/text()")) + ) + ); } return 1; }, @@ -145,9 +150,9 @@ public void exec() { if (!errors.isEmpty()) { throw new IllegalStateException( String.format( - "%d files with parsing errors were found: %s", + "%d files with parsing errors were found:\n%s", errors.size(), - Arrays.toString(errors.toArray()) + String.join("\n", errors) ) ); } diff --git a/eo-parser/src/main/java/org/eolang/parser/EoSyntax.java b/eo-parser/src/main/java/org/eolang/parser/EoSyntax.java index 77bad1a4cb..1b51b4ecde 100644 --- a/eo-parser/src/main/java/org/eolang/parser/EoSyntax.java +++ b/eo-parser/src/main/java/org/eolang/parser/EoSyntax.java @@ -49,7 +49,11 @@ public final class EoSyntax implements Syntax { /** - * The name of it. + * The name of the EO program being parsed, usually the name of + * .eo file itself. This name will be present in the + * generated XML. This is done for the sake of traceability: it will + * always be possible to tell which XMIR file was generated from + * which EO program. */ private final String name; @@ -61,8 +65,18 @@ public final class EoSyntax implements Syntax { /** * Ctor. * - * @param nme The name of it - * @param ipt Input text + * @param ipt The EO program to parse + * @since 0.40.0 + */ + public EoSyntax(final Input ipt) { + this("unknown", ipt); + } + + /** + * Ctor. + * + * @param nme The name of the EO program being parsed + * @param ipt The EO program to parse */ public EoSyntax(final String nme, final Input ipt) { this.name = nme; @@ -99,11 +113,15 @@ public XML parsed() throws IOException { ); new Schema(dom).check(); if (spy.size() == 0) { - Logger.debug(this, "Input of %d EO lines compiled, no errors", lines.size()); + Logger.debug( + this, + "The %s program of %d EO lines compiled, no errors", + this.name, lines.size() + ); } else { Logger.debug( - this, "Input of %d EO lines failed to compile (%d errors)", - lines.size(), spy.size() + this, "The %s program of %d EO lines failed to compile (%d errors)", + this.name, lines.size(), spy.size() ); } return dom; diff --git a/pom.xml b/pom.xml index c1dfd873ee..380ce823c4 100644 --- a/pom.xml +++ b/pom.xml @@ -140,26 +140,26 @@ SOFTWARE. org.junit junit-bom - 5.10.3 + 5.11.1 pom test org.junit.jupiter junit-jupiter-engine - 5.10.3 + 5.11.1 test org.junit.jupiter junit-jupiter-params - 5.10.3 + 5.11.1 test org.junit.jupiter junit-jupiter-api - 5.10.3 + 5.11.1 test