Repository navigation
refactor: remove the list_growth lint - #207
Merged
Merged
Conversation
The list_growth lint counted every list item of a file, at every depth, and failed the file when a change left it with more items than it had at the merge base. It was broken by design: any growth failed, whoever added the item and why, and the only way to exempt one item was to take the whole file off the lint. It is removed as if it had never existed. The lint module, its settings table, its violation, its case directory, its tests, its instructions page and its 0.0.1 record entry are gone. So is the plumbing that only it used: the error for a run with no base, the base text of a changed file, the commit field of a change, the Markdown blocks need of a lint, and the corpus tool's stripping of change lints from a config. The corpus tool no longer depends on serde-saphyr. No changelog entry is written. --base stays on check and fix. The notice for an allow entry that a change adds or changes reads the change, and so does the base in the JSON report. Its help text now says that. make check-deslag keeps --base origin/main for the same notice. The repo's own config loses the list_growth overrides and the comments about them. The setup guide is 4847 bytes and its budget falls to match. The frozen 0.0.1 configs lose their list_growth key, and their hashes are updated. The golden file of the lint and its writer in tests/blobs.rs are gone, and make fix-blobs, which rewrote it beside the catalogue, folds into fix-catalog. Tests that passed --base HEAD for this lint alone no longer do. No case under tests/cases outside the lint's own changed.
webern
marked this pull request as ready for review
October 25, 2026 14:04
5 tasks done
webern
added a commit
that referenced
this pull request
Nov 29, 2026
…erride (#273) ## 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 - [x] `make ci-fast`: exit 0, including `check-deslag` on the repo itself - [x] `make test-tools`: exit 0 - [x] New `density` cases: `override_off`, `allow_applied`, `allow_fails` (covering `no_such_block` and `no_finding`), `allow_rust` and `allow_fix_held` - [x] Unit tests for the `off` load errors, the merge order and `two_blocks`, plus a new `deslag explain` test - [x] 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 - Closes #68 - Related: #67, #199, #207, #251
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human Summary
Removes a badly conceived and badly implemented lint.
Summary
list_growthwas a lint that judged a change rather than a file. With a base such as--base origin/main, it counted every list item of a file, at every depth, at the merge base and on disk, and failed the file if the count went up by even one. Moving or rewording an item was free; adding one was not, whoever added it and why. Its only exemption was to take the whole file out of the override that turned it on, and anallowentry for it was refused. It was broken by design, and this PR takes it out of deslag as if it had never existed. No other lint's output changes.What was removed
src/lint/list_growth.rs, itsLintandViolationvariants, itsListGrowthsettings table, its arm in theallowrefusal, its instructions page, and its 0.0.1 record entrysrc/changelog/releases/0.0.1/lint.list_growth.toml. No changelog entry of any kind is written for the removal.Error::NoBase(the exit 2 for a run with no base),Lint::reads_change,lint::Before,Change::base_text,Change::commit,change::File::adds, and theNeed::Structureneed ("needs the blocks of Markdown"), with the section argument ofStack::asksthat only its message read.check_textnow takes the phrase stamp directly in place of theJudgingstruct, whose other field was the change.fix::fixno longer takes a change.README.md, the[cpp]and[toml]schema docs, and the 0.0.1 entriesfeature.cpp,feature.rust,feature.toml,setting.cpp.surfacesandsetting.rust.surfaces. The guide andREADME.mdalso lose the warning that--base HEADjudges only uncommitted work, which was there because the lint passed under it. Comments that described the base as what lints judge a change from now say what reads it:ci.yml's fetch depth, the.basedirectory of a case intests/slow/cases.rs,tools/corpus/report.toml, and the JSON schema descriptions ofbase..agents/deslag.toml: thelist_growth = {}lines, the override that existed only to turn it on for two skills, and the comments about it. The byte budgets are unchanged except the guide's, which falls from 5065 to its new size, 4847.tests/growth.rs,tests/cases/list_growth/, thetests/golden/list_growth.txtwriter intests/blobs.rsand the file itself. Elsewhere only the lint was taken out: a test that used it as a sample lint now usesnot_at_all.tests/frozen.rsandtests/output.rsno longer put their repos under git and pass--base HEAD, which they did only because of this lint; no assertion read the base. Intests/slow/update.rs, the frozen-config probe rancheck --base HEADin a repo that is not under git, so before and after the update it compared two exit 2s. It now runs a plaincheck, asserts that every probe exits 0 before the update so the comparison is not inert, and asserts thatcheckafter the update exits 0 and warns of no removed setting. The frozen 0.0.1 configs lose theirlist_growthkey, andtests/configs/hashesgets their new hashes.deslag-corpus lintsno longer re-reads the config to strip the lints that judge a change, so it no longer depends onserde-saphyr(one line less inCargo.lock). Its test for that stripping is gone; a small test,lints_read_the_config_deslag_finds_when_given_none, keeps the check that the default config is.agents/deslag.toml.make fix-blobswas the same recipe asmake fix-catalog, so it is gone andfix-catalog, which already fetches the image first, is the one target.scripts/blobstore/remeasure.shruns it and no longer reports or lists the golden file;publish-blobs.yml,batches.md,blobs.mdand the help text namefix-catalog.What
--basebecameIt stays on
checkandfix, as it was. Without the lint, two things still read the change it gives: thedeslag: notice:line for eachallowentry the change adds or changes (src/lint/mod.rs,check_repocallsallow::mark_added), whichcheckand the check afterfixboth print, and thebaseobject of the JSON report. Thenext/entries forallowalready documentdeslag check --basefor that notice. Its help text now says it gives that notice in place of "for the lints that compare a file with what it was".fix --basestill reads the base before writing anything, so a bad base still exits 2 with nothing written.make check-deslagkeepscheck --base origin/main, for the same notice, and its comment now says so.--diffis unchanged.Testing
make ci-fast: exit 0make CARGO_FLAGS=--locked preflight check build test: exit 0. These are the targets ofmake ciexcepttest-blobsandtest-scanners, which were skipped:test-blobsfetches the corpus image andtest-scannersvendors crates withfetch-crates, and both need the network. The ignored test removed fromtests/blobs.rswas the only part oftest-blobsthat read the lint.python3 -m unittest discover -b -s scripts/blobstore -p 'test_*.py': 110 tests, OK.make test-pythonrefused to run because its preflight wants Python 3.13 and this machine has 3.14.make test-product, which runstests/slow/with every other product test, passed after the changes totests/slow/update.rs,tests/output.rsandtests/slow/cases.rs: exit 0.make test-tools: exit 0.make fix-test-outputchanged nothing undertests/cases.git diff --stat origin/main -- tests/casesshows only the 35 deletions undertests/cases/list_growth/:35 files changed, 218 deletions(-).make fix-goldenchanged nothing undertests/golden/. In the corpus tool's goldens, the lints report and its JSON listrepo_layoutalone as left out, where main also listedlist_growth. The scope line also drops "and no base", the reason given for leavinglist_growthout; no lint row moved.grep -rni "list.growth\|listgrowth" --exclude-dir=target --exclude-dir=.git --exclude-dir=.blobs .prints nothing.make check-deslag: exit 0.References
--base.