Repository navigation
feat: the house-style lint for verbs with no-nouns - #59
Merged
Merged
Conversation
A pattern is a row of items written as Rust data: a literal word, a token kind, a suffix, a word in or not in listed sets, optional items and a bounded gap. It matches within one sentence, folds case the way banned_phrases does, and returns the token ranges of its matches, leftmost first, then longest, never overlapping.
verbs_no_nouns fails a sentence that negates a verb through its object, as in "ships no binary", where this repo writes "does not ship a binary". It is built on the token pattern matcher: a word ending in s with no apostrophe, then no, then a word. Closed sets of function words, clause verbs and idioms after no are Rust data, not config. It is off by default and takes only a message. The corpus test holds its claim on English fixtures: llm files hold it at least 3 times as often as human files on the tree. The big-tier catalogue pass, which already reads every file, checks the same ratio there and that at most 3% of human files hold it. The cases pin each false-positive class.
Turn verbs_no_nouns on for this repo and fix what it finds in the design docs and the blobstore notes.
deslag-corpus patterns counts the English files that hold each construction the pattern matcher finds, per label and per compared tool, with masked examples. It runs the constructions considered for a lint and not shipped, held in the CANDIDATES table in patterns.rs, and the verbs_no_nouns pattern by its lint's id. There is no flag for a pattern of the user's own. It reads each file again with Document::markdown, since the measured ids turn every code span into one separator. Files in another language get a table of their own and are in no label's rate. The masker moves out of candidates' examples into a function both commands call; it now masks code spans inside a match too.
webern
marked this pull request as ready for review
September 27, 2026 17:15
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.
Summary
deslag ships its first house-style lint. The owner's pet peeves are constructions, not strings, so this PR first builds the machinery they need: a closed pattern matcher over the document's tokens, in the library, where a lint and a measurement run the same code.
The matcher (
src/lint/pattern.rs) matches a sequence of items — a literal word, a token kind, a word with a suffix, a word in (or not in) a named set, a word without certain characters, an inline-code span — with optional items and a bounded gap, inside one sentence. No regular expressions over raw text, no user-supplied patterns, no part-of-speech guesses. Matches are leftmost-first, longest, and never overlap.The lint (
verbs_no_nouns) flags the "verbs no noun" construction from #43: "deslag ships no binaries" where "deslag does not ship binaries" is meant. It is off by default — unlike the phrase catalogue, it flags ordinary human prose too, so turning it on is a deliberate act:[md.lints.verbs_no_nouns]in the config, with the usualmessageoverride. The advice owns the rule as the house's style, never claims the sentence is machine-written, and says up front that swappingnoforzero,without,lacksorfree ofis not the fix — negate the verb or drop the absolute claim.The evidence is asserted, not stored. Nothing is recorded for a reader to trust: the claims are re-derived on every run. On the in-tree corpus the lint holds 62 of 380 llm files (16.3%) against 18 of 381 human (4.7%), a ratio of 3.4; the tests assert llm is at least 3 times human. On the corpus image the lint holds 1,325 of 7,709 llm files (17.2%) against 263 of 10,200 human (2.6%), a ratio of 6.7; the same every-fixture pass asserts the ratio and the 3% human ceiling there. This also answers #57's complaint about counted numbers: there are none to drift.
The measurement tool gains a
patternscommand that measures candidate constructions that did not ship, with masked matches, over files whose sidecar says they are English:The code-span series is structural and high-volume, but humans write triple-backtick lists too — the mixed tier sits at the llm tier — so it stays with the listing family of #16 rather than shipping as a peeve.
not X but Yis human-heavier than llm on the tree: it is ordinary English, not a tell. "it's not just" is rare enough that a phrase list, not a construction, is where it belongs if anywhere. Each rejection is recorded with its numbers so nobody re-proposes it without new evidence.False positives are pinned, not hoped away. The matcher excludes function words ending in s (
is,was,does,as,this,its, …), clause-complement verbs ("ensures no request is dropped" negates nothing), stop words afterno(no longer,no more), and any word containing an apostrophe (there's,let's). Each class is a case test that must not match. The exclusion words that the measurement earned are in the lint-visible sets; the remaining tree hits on human files are the construction itself, which is what a house-style rule is for.Testing
make ci: exit 0References