rule: validate provides labels in module init.lua #75

Closed
opened 2026-05-26 04:00:07 +02:00 by michael · 1 comment
Owner

Goal

Add a fragjan rule to validate the provides field in module init.lua files
against a list of known/allowed interface labels.

Background

DAW modules declare provides = { "<interface>" } in init.lua.
Currently no rule checks whether the value is a known interface label
(e.g. "ui", "storage", "vcs"). Unknown or misspelled labels
would go undetected.

Acceptance Criteria

  • Rule checks that provides field exists in init.lua
  • Rule checks each value against a configurable list of allowed labels
  • Unknown labels produce a finding with the invalid value
  • Allowed labels are defined in the rule YAML (not hardcoded)

Notes

Candidate pack: daw-module
Primitive needed: likely pattern or contains on init.lua
Related: DAW/fragjan#67-#74 (open rule issues)

## Goal Add a fragjan rule to validate the `provides` field in module `init.lua` files against a list of known/allowed interface labels. ## Background DAW modules declare `provides = { "<interface>" }` in `init.lua`. Currently no rule checks whether the value is a known interface label (e.g. `"ui"`, `"storage"`, `"vcs"`). Unknown or misspelled labels would go undetected. ## Acceptance Criteria - [ ] Rule checks that `provides` field exists in `init.lua` - [ ] Rule checks each value against a configurable list of allowed labels - [ ] Unknown labels produce a finding with the invalid value - [ ] Allowed labels are defined in the rule YAML (not hardcoded) ## Notes Candidate pack: `daw-module` Primitive needed: likely `pattern` or `contains` on `init.lua` Related: DAW/fragjan#67-#74 (open rule issues)
Author
Owner

Implemented: provides-valid-label rule added to daw-lua-module pack.

Uses new daw.fragjan.check.listvalues primitive (DAW/fragjan#84).
Whitespace normalization in primitive ensures alignment variants are caught.
{value} substitution in reporter via DAW/fragjan#85.

Implemented: provides-valid-label rule added to daw-lua-module pack. Uses new daw.fragjan.check.listvalues primitive (DAW/fragjan#84). Whitespace normalization in primitive ensures alignment variants are caught. {value} substitution in reporter via DAW/fragjan#85.
michael 2026-05-26 21:14:45 +02:00
michael added this to the Basic Version milestone 2026-05-30 16:04:44 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DAW/fragjan#75
No description provided.