Skip to content
Open
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
2 changes: 1 addition & 1 deletion src/main/java/org/eolang/lints/LtUnlint.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public Collection<Defect> defects(final XML xmir) throws IOException {
problematic.forEach(
line -> found.forEach(
defect -> {
if (line != 0 && defect.line() == line) {
if (defect.line() == line) {
defects.add(defect);
added.set(true);
}
Expand Down
13 changes: 13 additions & 0 deletions src/test/java/org/eolang/lints/LtUnlintTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,17 @@ void catchesAllOutOfRangeDefects() throws IOException {
Matchers.iterableWithSize(1)
);
}

@Test
void keepsLineZeroDefectWithLineSpecificUnlint() throws IOException {
MatcherAssert.assertThat(
"A line-0 defect must not be silently dropped by a line-specific unlint",
new LtUnlint(new LtByXsl("metas/mandatory-package")).defects(
new EoProgram(
"org/eolang/lints/unlint-mandatory-package-line.eo"
).parse()
),
Matchers.iterableWithSize(1)
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Missing package, but it should be reported anyway.
Comment thread
VasilevNStas marked this conversation as resolved.

+architect yegor256@gmail.com
+home https://www.eolang.org
+version 0.0.0
+spdx SPDX-FileCopyrightText: Copyright (c) 2016-2026 Objectionary.com
+spdx SPDX-License-Identifier: MIT
+unlint mandatory-package:5

# Boo.
[] > foo
Loading