Problem
LtTestNotVerb.motive() throws an exception because it references a motive file that does not exist.
Details
src/main/java/org/eolang/lints/LtTestNotVerb.java:59:
@Override
public String motive() throws IOException {
return new MotiveFrom("misc", "test-object-is-not-verb-in-singular").asString();
}
The resource org/eolang/motives/misc/test-object-is-not-verb-in-singular.md does not exist in src/main/resources/org/eolang/motives/misc/ — the only file there is incorrect-test-object-name.md. Since MotiveFrom.asString() reads the resource via TextOf, the missing file makes motive() fail with:
The resource "org/eolang/motives/misc/test-object-is-not-verb-in-singular.md" was not found ...
(I reproduced this locally by calling new LtTestNotVerb().motive().)
Impact
- The lint's own
name() returns unit-test-is-not-verb (line 45), so the motive reference is doubly wrong: it uses a different name than the lint, and that name has no file.
motive() is part of the public Lint contract and is delegated by wrappers (LtUnlint.motive(), LtDfSticky.motive()), so any tool that shows lint motives (e.g. IDE integrations, the motives workflow, or a future "explain this lint" feature) will crash on this lint.
- There is no unit test covering
LtTestNotVerb.motive(), which is why this went unnoticed.
Expected behaviour
LtTestNotVerb.motive() should return the content of a real motive file. Either:
- create
src/main/resources/org/eolang/motives/misc/unit-test-is-not-verb.md (matching name()), or
- point
motive() at the correct existing file.
A test asserting motive() succeeds (like LtAsciiOnlyTest.explainsMotive) should be added.
Problem
LtTestNotVerb.motive()throws an exception because it references a motive file that does not exist.Details
src/main/java/org/eolang/lints/LtTestNotVerb.java:59:The resource
org/eolang/motives/misc/test-object-is-not-verb-in-singular.mddoes not exist insrc/main/resources/org/eolang/motives/misc/— the only file there isincorrect-test-object-name.md. SinceMotiveFrom.asString()reads the resource viaTextOf, the missing file makesmotive()fail with:(I reproduced this locally by calling
new LtTestNotVerb().motive().)Impact
name()returnsunit-test-is-not-verb(line 45), so the motive reference is doubly wrong: it uses a different name than the lint, and that name has no file.motive()is part of the publicLintcontract and is delegated by wrappers (LtUnlint.motive(),LtDfSticky.motive()), so any tool that shows lint motives (e.g. IDE integrations, the motives workflow, or a future "explain this lint" feature) will crash on this lint.LtTestNotVerb.motive(), which is why this went unnoticed.Expected behaviour
LtTestNotVerb.motive()should return the content of a real motive file. Either:src/main/resources/org/eolang/motives/misc/unit-test-is-not-verb.md(matchingname()), ormotive()at the correct existing file.A test asserting
motive()succeeds (likeLtAsciiOnlyTest.explainsMotive) should be added.