feat(tools): L10 ludic-fmt enforces a project's style

lint lines in package.ludic - one_statement, max_file_lines, max_function_lines,
max_comment_lines, max_header_lines, paths, baseline - checked by ludic-fmt --check
<files> and ludic-fmt --lint (the project), at the line; a baseline ratchet lets a
rule arrive in a codebase that breaks it (--init-baseline), lowered as it is fixed.
check-impl reads the alias declarations too (it had been blind to every namespace
L6 moved out of the compiler), and eight methods get their pages; a test holds the
formatter to keeping type arguments together (L5).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-24 14:38:35 +03:00
parent e543525eb7
commit 334469ef61
16 changed files with 635 additions and 2 deletions

View file

@ -1360,6 +1360,23 @@ checked. Diagnostics are limited to parse-level errors, reported as
`file:line: error: message`; richer static checks (unknown identifiers,
duplicate types, unknown fields, arity) are future work.
`ludic-fmt --check` also enforces a project's style, stated in its `package.ludic`:
```
lint one_statement # two statements on one line
lint max_file_lines 100
lint max_function_lines 50
lint max_comment_lines 2 # a comment says why, in a line or two
lint max_header_lines 3 # the comment that opens a file
lint paths "src" "lab" # what `ludic-fmt --lint` walks
lint baseline "tests/lint-baseline.txt"
```
`ludic-fmt --lint` checks the project's paths; the baseline is a ratchet - the violations each file
had when a rule came in, which it may keep but not add to, lowered automatically as they are
fixed - so a rule can arrive in a codebase that breaks it today (`ludic-fmt --init-baseline`
writes it). A `;` or a `#` inside a string does not count.
### Editors
```bash