objectionary / objectionary/lints

`+unlint` fails to warn when given invalid values, leading to silent suppression failures

Open
#1,388 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Problem

Malformed +unlint values such as +unlint foo:abc or +unlint foo: (empty line part) are silently ignored: the lint neither suppresses anything nor warns about the bad format, so a user typo quietly disables an intended suppression.

Root cause

src/main/java/org/eolang/lints/LtUnlint.java:62-72 parses the +unlint tail into three buckets (global, single/range via regex, and granular):

final boolean global = !unlint.matches(UNLINT_LINE_REGEX);
...
final boolean granular = ... starts-with(tail, name + ":") ...

A tail like foo:abc or foo: matches the granular predicate but none of the three regex branches, so it falls through with no effect. LtIncorrectUnlint validates only the name part (up to :), not the format after it.

Minimal example

+package x
+architect yegor@256.com
+version 0.0.1
+home https://github.com/objectionary
+spdx SPDX-FileCopyrightText: Copyright (c) 2026 Objectionary.com
+spdx SPDX-License-Identifier: MIT
+unlint ascii-only:abc

[] > main
  # Привет
  42 > @

The ascii-only defect is NOT suppressed (fine), but the user is never told that ascii-only:abc is an invalid format — the suppression silently does nothing.

Expected behavior

A +unlint with an invalid line/range part should produce a warning (either from LtUnlint or from LtIncorrectUnlint), so the user learns about the typo.

Related

  • LtIncorrectUnlint.java — currently validates only the lint name.
  • The +unlint format is parsed independently in three places (LtUnlint, DefectMissing, UnlintInRange) — a shared parser would make validation consistent.

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 src/main/java/org/eolang/lints/LtUnlint.java:62-72 and compare how malformed tails are classified. Review LtIncorrectUnlint, DefectMissing, and UnlintInRange, which independently parse +unlint values. Done means invalid line or range parts such as foo:abc and foo: produce a warning instead of being silently ignored.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.