diff --git a/.codacy.yml b/.codacy.yml index d5ed85e1605..1f7e620dba2 100644 --- a/.codacy.yml +++ b/.codacy.yml @@ -27,3 +27,4 @@ exclude_paths: - "src/test/groovy/*.groovy" - "eo-runtime/src/test/java/integration/PhiUnphiIT.java" + - "eo-maven-plugin/src/test/java/org/eolang/maven/LintMojoTest.java" diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/LintMojo.java b/eo-maven-plugin/src/main/java/org/eolang/maven/LintMojo.java index 301ec2518ee..e674f0ac345 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/LintMojo.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/LintMojo.java @@ -24,6 +24,7 @@ package org.eolang.maven; import com.jcabi.log.Logger; +import com.jcabi.manifests.Manifests; import com.jcabi.xml.XML; import com.jcabi.xml.XMLDocument; import java.io.IOException; @@ -116,6 +117,11 @@ private void lint() throws IOException { "Linted %d out of %d XMIR program(s) that needed this (out of %d total programs) in %[ms]s: %s", passed, tojos.size(), tojos.size(), System.currentTimeMillis() - start, sum ); + Logger.info( + this, + "Read more about lints: https://www.objectionary.com/lints/%s", + Manifests.read("Lints-Version") + ); if (counts.get(Severity.ERROR) > 0 || counts.get(Severity.CRITICAL) > 0) { throw new IllegalStateException( String.format( diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/LintMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/LintMojoTest.java index 17e9a4b5eae..80342b61ea4 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/LintMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/LintMojoTest.java @@ -84,6 +84,32 @@ void lintsAgainAfterModification(@Mktmp final Path temp, @RandomProgram final St ); } + @Test + void printsLintsUrlWithVersion(@Mktmp final Path temp, @RandomProgram final String program) + throws IOException { + new Farea(temp).together( + f -> { + f.clean(); + f.files().file("src/main/eo/foo.eo").write(program.getBytes()); + f.build() + .plugins() + .appendItself() + .execution() + .goals("register", "parse", "shake", "lint") + .configuration() + .set("failOnWarning", "false"); + f.exec("process-classes"); + MatcherAssert.assertThat( + "Lints URL was not printed, but it should", + f.log().content(), + Matchers.matchesPattern( + "(?s).*\\[INFO] Read more about lints: https://www\\.objectionary\\.com/lints/\\d+\\.\\d+\\.\\d+.*" + ) + ); + } + ); + } + @Test void doesNotFailWithNoErrorsAndWarnings(@Mktmp final Path temp) { Assertions.assertDoesNotThrow(