Skip to content

Commit

Permalink
Merge branch 'master' into 2937-update-qulice
Browse files Browse the repository at this point in the history
  • Loading branch information
c71n93 committed Mar 25, 2024
2 parents 6c74e9c + 7311c40 commit 0846194
Show file tree
Hide file tree
Showing 156 changed files with 9,201 additions and 2,219 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: teatimeguest/setup-texlive-action@v3.1.0
- uses: teatimeguest/setup-texlive-action@v3.2.1
with:
update-all-packages: true
packages: scheme-basic geometry xcolor naive-ebnf microtype etoolbox
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/daily.yml
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: teatimeguest/setup-texlive-action@v3.1.0
- uses: teatimeguest/setup-texlive-action@v3.2.1
with:
update-all-packages: true
packages: scheme-basic geometry xcolor naive-ebnf microtype etoolbox
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ebnf.yml
Expand Up @@ -17,7 +17,7 @@ jobs:
- run: |
sudo apt-get update
sudo apt-get -y install ghostscript imagemagick texlive-extra-utils pdf2svg inkscape
- uses: teatimeguest/setup-texlive-action@v3.1.0
- uses: teatimeguest/setup-texlive-action@v3.2.1
with:
update-all-packages: true
packages: scheme-basic geometry xcolor naive-ebnf microtype etoolbox
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/latexmk.yml
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: yegor256/latexmk-action@0.10.9
- uses: yegor256/latexmk-action@0.11.1
with:
path: paper
opts: -pdf
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/markdown-lint.yml
Expand Up @@ -15,5 +15,5 @@ jobs:
markdown-lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694
- uses: actions/checkout@cd7d8d697e10461458bc61a30d094dc601a8b017
- uses: articulate/actions-markdownlint@v1
17 changes: 17 additions & 0 deletions .github/workflows/reports-check.yml
@@ -0,0 +1,17 @@
---
name: reports-check
on:
issues:
types: [opened]
permissions:
issues: write
contents: read
jobs:
check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: tracehubpm/reports-check-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
openai_token: ${{ secrets.OPENAI_API_KEY }}
2 changes: 1 addition & 1 deletion .github/workflows/simian.yml
Expand Up @@ -24,4 +24,4 @@ jobs:
- run: |
wget --quiet http://public.yegor256.com/simian.jar -O /tmp/simian.jar
- run: |
java -jar /tmp/simian.jar -threshold=16 -excludes=**/gen -excludes=**/it **/*.java
java -jar /tmp/simian.jar -threshold=18 -excludes=**/gen -excludes=**/it **/*.java
2 changes: 1 addition & 1 deletion .github/workflows/sonar.yml
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0
- uses: teatimeguest/setup-texlive-action@v3.1.0
- uses: teatimeguest/setup-texlive-action@v3.2.1
with:
update-all-packages: true
packages: scheme-basic geometry xcolor naive-ebnf microtype etoolbox
Expand Down
2 changes: 1 addition & 1 deletion .rultor.yml
Expand Up @@ -3,7 +3,7 @@ architect:
ec2:
type: t2.large
docker:
image: yegor256/rultor-image:1.22.0
image: yegor256/rultor-image:1.23.1
assets:
settings.xml: yegor256/objectionary-secrets#settings.xml
pubring.gpg: yegor256/objectionary-secrets#pubring.gpg
Expand Down
4 changes: 2 additions & 2 deletions eo-maven-plugin/README.md
Expand Up @@ -35,7 +35,7 @@ create a file `pom.xml` with this content (it's just a sample):
<plugin>
<groupId>org.eolang</groupId>
<artifactId>eo-maven-plugin</artifactId>
<version>0.35.9</version>
<version>0.35.11</version>
<executions>
<execution>
<goals>
Expand Down Expand Up @@ -156,7 +156,7 @@ execution within `eo-maven-plugin/pom.xml`:
...
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<version>0.35.9</version>
<version>0.35.11</version>
<configuration>
<skipInstallation>true</skipInstallation>
<skipInvocation>true</skipInvocation>
Expand Down
61 changes: 52 additions & 9 deletions eo-maven-plugin/src/main/java/org/eolang/maven/PhiMojo.java
Expand Up @@ -34,6 +34,7 @@
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
Expand Down Expand Up @@ -108,6 +109,12 @@ public void exec() {
Runtime.getRuntime().availableProcessors(),
new Mapped<>(
xmir -> () -> {
final Path processed = this.phiInputDir.toPath().relativize(xmir);
Logger.info(
this,
"Processing XMIR: %[file]s (%[size]s)",
processed, xmir.toFile().length()
);
final XML xml = new XMLDocument(
new TextOf(xmir).asString()
);
Expand All @@ -118,11 +125,26 @@ public void exec() {
String.format(".%s", PhiMojo.EXT)
)
);
home.save(PhiMojo.translated(train, xml), relative);
try {
home.save(PhiMojo.translated(train, xml), relative);
} catch (final ImpossibleToPhiTranslationException exception) {
Logger.debug(
this,
"XML is not translatable to phi:\n%s",
xml.toString()
);
throw new IllegalStateException(
String.format("Couldn't translate %s to phi", processed),
exception
);
}
Logger.info(
this,
"Translated to phi: %s -> %s",
xmir, this.phiOutputDir.toPath().resolve(relative)
"Translated to phi: %[file]s (%[size]s) -> %[file]s (%[size]s)",
processed,
xmir.toFile().length(),
relative,
this.phiOutputDir.toPath().resolve(relative).toFile().length()
);
return 1;
},
Expand All @@ -148,13 +170,34 @@ count, new Rel(this.phiInputDir), new Rel(this.phiOutputDir)
* @param train Train that optimize and traslates given xmir
* @param xmir Text of xmir
* @return Translated xmir
* @throws ImpossibleToPhiTranslationException If fails to translate given XMIR to phi
*/
private static String translated(final Train<Shift> train, final XML xmir) {
return new Xsline(
private static String translated(final Train<Shift> train, final XML xmir)
throws ImpossibleToPhiTranslationException {
final XML translated = new Xsline(
train.with(new StClasspath("/org/eolang/maven/phi/to-phi.xsl"))
)
.pass(xmir)
.xpath("phi/text()")
.get(0);
).pass(xmir);
Logger.debug(PhiMojo.class, "XML after translation to phi:\n%s", translated);
final List<String> phi = translated.xpath("phi/text()");
if (phi.isEmpty()) {
throw new ImpossibleToPhiTranslationException(
"Xpath 'phi/text()' is not found in translated XMIR"
);
}
return phi.get(0);
}

/**
* Exception which indicates that translation to phi can't be processed.
* @since 0.36.0
*/
private static class ImpossibleToPhiTranslationException extends Exception {
/**
* Ctor.
* @param cause Cause of the exception.
*/
ImpossibleToPhiTranslationException(final String cause) {
super(cause);
}
}
}
Expand Up @@ -30,10 +30,17 @@ SOFTWARE.
<xsl:variable name="t">
<xsl:choose>
<xsl:when test="@base">
<xsl:text>bound</xsl:text>
<xsl:choose>
<xsl:when test="@cut">
<xsl:text>formed</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>bound</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:text>free</xsl:text>
<xsl:text>void</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
Expand Down

0 comments on commit 0846194

Please sign in to comment.