objectionary / objectionary/lints

`LtUnlint` silently drops defects at line 0 when a line-specific `+unlint` meta is present

Open Beginner friendly
#950 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
14
Forks
39
Avg merge
22h 54m
Merged PRs (30d)
90

Description

What happens: In LtUnlint.defects() (line 83), the loop that re-adds non-suppressed defects to the result uses the guard line != 0 && defect.line() == line. When a lint produces a defect at line 0 (which happens whenever an XMIR element has no @line attribute — e.g. mandatory-package reports at line 0 when the whole +package meta is absent), and the EO program also contains a line-specific +unlint meta for the same lint (e.g. +unlint mandatory-package:5), the following occurs: (1) global is set to true because a +unlint meta exists; (2) line 5 is removed from problematic but line 0 stays; (3) the loop skips line 0 due to line != 0; (4) added remains false; (5) the fallback if (!added.get() && !global) defects.addAll(found) is also skipped because global is true. The defect at line 0 is silently discarded even though it was never targeted by the +unlint meta. The lineno.xsl helper and empty-object.xsl both explicitly handle line 0 (the XSL even adds a context attribute when $line = '0'), confirming that line-0 defects are an intentional, production-occurring case.

What should happen: A defect at line 0 that is not covered by a global +unlint lint-name suppression should always be reported, regardless of whether other line-specific +unlint metas exist for the same lint.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in LtUnlint.defects() at line 83 and inspect how line-specific and global +unlint metas affect defects with line 0. Review lineno.xsl and empty-object.xsl for the existing line-0 behavior. Done means an uncovered line-0 defect remains reported when a line-specific suppression exists, while a global suppression still suppresses it.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.