Skip to content

feat: exempt one paragraph from density, and turn a lint off in an override - #273

Merged
webern merged 1 commit into
mainfrom
claude/compassionate-edison-uv3gwa
Nov 29, 2026
Merged

webern merged 1 commit into
mainfrom
claude/compassionate-edison-uv3gwa

Conversation

@webern

@webern webern commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Human Summary

This gives the user the ability to exempt a single lint case.

Summary

Issue #68 asked for two things. The first is a way to exempt one violation, keyed to its place and not to the whole file. The second is a way for a narrower override to turn off a lint that a broader override turned on.

Much of the first already exists. [[<section>.allow]] entries (#199, #251) exempt one sentence, they require a reason, a tally of them prints on every run, and a stale entry fails the check. list_growth, the lint behind #67, was removed in #207, so there was no list count to rebase. What was still missing:

  • density could not be exempted. An allow entry for density now quotes one whole paragraph or list item, folded the same way a sentence quote is. Any edit to that block makes the entry stale, and the block is judged again. So a paragraph that grows has to be re-exempted by a human, and an entry does not last forever. A failed entry reports no_such_block, two_blocks or no_finding. deslag fix leaves a quoted block as it is. A line on a density entry is refused.
  • An override can now say off = ["<lint>", ...]. This sets each named lint back to unset for the files the override matches. A later override that sets the lint's table turns it back on, with only the settings that table sets. Loading the config (exit 2) refuses an unknown lint, a lint named twice, a lint the same override both turns off and sets, and an off for a lint that no table in the section turns on. deslag explain shows # <lint>: off, by override N. The field is marked since = "next" with a default of [], so it needs no schema version bump.

Exemptions stay in the config, with no in-file marker. That keeps to the existing rule that there is one way to exempt a finding.

guide.md and lints/allow.md no longer say that an override cannot turn a lint off, or that an entry only exempts a sentence. They keep the rule that an agent proposes an entry or an off and a human writes it. The summary line, the SARIF rule text and the docs for entries now say "text" rather than "sentence", since an entry can name a paragraph.

.agents/deslag.toml is unchanged. The #67 workaround was already removed along with list_growth.

Testing

  • make ci-fast: exit 0, including check-deslag on the repo itself
  • make test-tools: exit 0
  • New density cases: override_off, allow_applied, allow_fails (covering no_such_block and no_finding), allow_rust and allow_fix_held
  • Unit tests for the off load errors, the merge order and two_blocks, plus a new deslag explain test
  • Expected outputs regenerated with make fix-test-output, and the diff checked. Existing density cases changed only by the added advice sentence and the sentence-to-text wording.

References

@webern webern added area/config Has to do with deslag configuration (deslag.yaml, etc.) area/lint Deals with the linting algorithms themselves, how they work. enhancement New feature or request labels Nov 29, 2026 — with Claude
…erride

Two changes for #68.

A density entry in `allow` now names one paragraph or list item. Its
quote is the whole block, folded like a sentence quote, so any edit to
the block makes the entry stale and the block is judged again. Failed
entries report no_such_block, two_blocks or no_finding. fix leaves a
block that an entry quotes as it is.

An override takes `off = ["<lint>", ...]`, which sets each named lint
back to unset for the files it matches. A later override that sets the
lint's table turns it on again with only what that table sets. Load
refuses an unknown lint, a lint named twice, a lint the same override
also sets, and a lint no table of the section turns on. `deslag explain`
shows `# <lint>: off, by override N`.

The guide no longer says an override cannot turn a lint off. Only a
human writes an entry or an off. The summary line, the SARIF rule and
the docs of an entry now speak of text, not only of a sentence, since an
entry can name a paragraph.
@webern
webern force-pushed the claude/compassionate-edison-uv3gwa branch from 7cf1142 to 9153378 Compare November 29, 2026 15:23
@webern
webern merged commit 6199ccc into main Nov 29, 2026
9 checks passed
@webern
webern deleted the claude/compassionate-edison-uv3gwa branch November 29, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Has to do with deslag configuration (deslag.yaml, etc.) area/lint Deals with the linting algorithms themselves, how they work. enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exempt one list, or one violation, from a lint

1 participant