Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
6 changes: 6 additions & 0 deletions eo-maven-plugin/src/main/java/org/eolang/maven/LintMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(
Expand Down
26 changes: 26 additions & 0 deletions eo-maven-plugin/src/test/java/org/eolang/maven/LintMojoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down