feat(modules): add the writing rules of the lint layer and the ingredient-database Quick Fix #298
No reviewers
Labels
No labels
bug
discussion
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gram-lang/gram!298
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/modules-lint-rules"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PR 5b-2 of
.notes/backlog/plan-dx-et-aides-ecriture.md(Phase 1 § 1C): new rules of@gram-lang/modules/lintand theADD_TO_INGREDIENTS_DBQuick Fix.Lint layer (
@gram-lang/modules/lint)LOST_INGREDIENT(warning):lostFrom(compilation, findWrittenIngredients(text)), kept only for tokens inside a mid-step//comment (a section title, a preparation,&@xor@@are not reported).LintInput.compilationgainsregistry?.findWrittenIngredientsstays backward compatible and now also skips@usedirectives and a CRLF frontmatter (closed blocks only, old regex as fallback).MERGED_STEP_LINE(info): a[Action]line, a## …line, or the line after one ending with->&…, glued under a step. Block comments and the frontmatter are skipped. Preferred fix inserts the blank line, keeping CRLF. (The "line right under## Section" case from the plan is not flagged: the parser reads it as a step.)SUSPECT_INGREDIENT_NAME(hint): braced names with,;.(after a 4+ letter word, soSt. John's wortis spared)、。, more thanSUSPECT_NAME_MAX_WORDS = 6words orSUSPECT_NAME_MAX_GRAPHEMES = 40graphemes. Non-preferred split fix@A{q}(B).UNREAD_FRONTMATTER(warning): closed block with keys, emptymeta; anchored on the first# …or indented line; "Remove this line" only on a# …line.MISSING_TITLEis dropped when the unread block writestitle:.ADD_TO_INGREDIENTS_DB: second, never-preferred fix ofUNKNOWN_INGREDIENTwhenLintInput.ingredientsFile: { uri, text }is given. Commented skeleton inserted at the end of theingredients:block or of the file, escaped name, CRLF and missing final newline handled, no duplicate when the entry is already in the buffer.createFiledropped for now (unreachable: no database, no diagnostic).Language server
ClientProfile.documentChanges; Quick Fixes are written asdocumentChanges(TextDocumentEdit,version: null) for clients that support them, elsechanges.UNKNOWN_INGREDIENTasks for its Quick Fixes.Docs & changeset
warnings.mdx(en + fr): one section per new code and the database Quick Fix;modules.mdx(en + fr):LintInput.minorchangesetmodules-lint-writing-rules.md, complementary tomodules-lint.md.Checks
bun test: 4312 pass / 1 skip (baseline 4269 / 1); 43 new tests, none removed or renamed (junit diff); positive tests red without the code.gramfences (❌/✅ blocks excluded).deprecations:checkno drift,fuzz --iterations 50000(seed 3248443166): 0 signature.The
isPreferredidempotence invariant in the fuzz is left to PR 6, as agreed; each rule has its own idempotence test here.