Repository navigation
Description
We studied Vale's source (v3.23.0, commit 2753160f) for ideas. The ideas we are taking have issues of their own: #28, #29, #30, #31, #32 and #33. This issue records the ones we decided against, and the ones we are leaving for later, so that nobody proposes them again without new evidence. Links point to that commit.
Not taking
Finding matches by searching the source. Vale turns Markdown into HTML, lints the HTML's text, and then searches the original file to find where each match came from (internal/lint/walk.go#L521, internal/core/location.go). A large share of Vale's code, and many of its bug fixes, go to that search. In deslag every position in Document is a byte range into the source, so there is nothing to search for. Keep it that way: never work out a position from rendered or rewritten text.
Regular expressions over raw text as the way rules match. Vale's regex engine can panic on a pathological pattern (internal/regex/regex.go#L16-L20), and raw text includes code and markup. deslag matches on its tokens.
Formulas and scripts in rules. Vale's metric rules take a formula, and a name the formula misspells quietly becomes 0 (internal/check/metric.go#L82-L88). The formula is pasted into program text and then checked for injection (internal/check/metric.go#L133-L136). Script rules embed a whole language (internal/check/script.go). deslag's lints are Rust, with typed settings that reject unknown fields.
CSS selectors for where a rule applies (doc(...) in internal/check/scope.go#L227). deslag's block kinds are a small closed set, and a selector language is far more than they need.
Style packages fetched with vale sync, and rules that inherit from other rules. They answer a need deslag doesn't have: sharing third-party rule sets.
Comments in a file that turn rules off (<!-- vale off --> and the like, internal/core/file.go#L22-L26). An agent that fails a lint would write its own exemption. The guide already tells agents not to change the config to get past a check, and an off comment is the same move. If this is ever reconsidered, it needs the config's permission. It should also work the way Vale's does: the off and on comments mark byte ranges, and findings inside them are dropped when the run reports, rather than a switch flipped while the file is read.
A slot for a part-of-speech tagger with no tagger behind it. Token.word_type is already that slot. When a tagger is chosen, copy two things from Vale: load it only when a rule needs it (internal/nlp/prose.go#L23-L31), and map its fine-grained tags onto a small portable set (internal/check/upos.go).
Negated globs (!pattern, internal/glob/glob.go#L45-L49). Vale negates one pattern on its own terms, so in a list where any pattern may match, a negated one matches nearly every file. A .ignore file already keeps files out of deslag's walk.
A precomputed table of counts per document. Vale needs one because its formulas look counts up by name. A Rust lint can count what it needs with Document::walk.
Leniency. Vale:
- warns and carries on at an unknown config key (internal/core/ini.go#L573-L577);
- keeps the first of two rules with the same name without a word (internal/check/manager.go#L274-L278);
- merges config from several places;
- has
--no-exit(cmd/vale/flag.go#L36); - has severity levels where only "error" fails a run.
deslag gates CI. It keeps one config file, rejects what it doesn't know, and fails on every finding.
Not yet
Each of these waits for a real need, named here.
- Frontmatter read as fields, each with its position, so a lint can check a field such as
description. Wait for a lint that needs it. - A value that clears a setting, so an override can switch a lint off for some files. Vale's is
UNSET(internal/core/ini.go#L234-L236). Wait for someone to need it. - Patterns in the config that mark text as code, such as template placeholders, so that prose lints skip it. Vale has
BlockIgnoresandTokenIgnores(internal/lint/html.go). Wait for a fixture where such syntax trips a lint. - Config errors that point at the line, with a caret (
annotateininternal/core/error.go). This needs positions from all three config parsers. - One finding type with a byte range, and JSON output. Wait for a tool that needs to read deslag's results.
- A fix command, limited at first to the replacements
banned_charsalready names.
Activity
webern commentedon Sep 26, 2026
Bad clanker, what a stupid issue to write 🙄
docs: credit the projects deslag borrows from (#36)
test: pin a case for every lint (#37)
feat: ban phrases the config lists (#41)
build: fetch the corpus's big tier from an OCI image (#45)
feat: locate every finding and print it as json, sarif or github (#47)
feat: add deslag fix for banned characters (#51)
feat: exclude globs in sections and overrides (#195)
feat: find the config by searching up to the top of the work tree (#250)