Skip to content

Ideas from Vale that deslag is not taking #34

Closed

Description

@webern

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:

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 BlockIgnores and TokenIgnores (internal/lint/html.go). Wait for a fixture where such syntax trips a lint.
  • Config errors that point at the line, with a caret (annotate in internal/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_chars already names.

Activity

  1. added
    design
    ai
    on Sep 26, 2026
  2. webern commented on Sep 26, 2026

    @webern
    OwnerAuthor

    Bad clanker, what a stupid issue to write 🙄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    aidesign

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions