bug(init-has-provides): rule missing expected: true -- fires on valid files #122

Closed
opened 2026-06-03 13:26:05 +02:00 by michael · 0 comments
Owner

Problem

init-has-provides rule fires an error on init.lua files that DO have
provides = in their metadata block.

Root cause

The rule uses daw.fragjan.check.pattern without expected: true.
Default for expected is false, meaning "warn if pattern IS found".
The rule intends the opposite: warn if pattern is NOT found.

Fix

Add expected: true to the rule:

check:
  primitive: daw.fragjan.check.pattern
  pattern: "provides ="
  match_type: contains
  skip_comments: true
  expected: true

Acceptance criteria

  • init-has-provides passes for init.lua files containing provides =
  • init-has-provides errors for init.lua files missing provides =
## Problem `init-has-provides` rule fires an error on `init.lua` files that DO have `provides =` in their metadata block. ## Root cause The rule uses `daw.fragjan.check.pattern` without `expected: true`. Default for `expected` is `false`, meaning "warn if pattern IS found". The rule intends the opposite: warn if pattern is NOT found. ## Fix Add `expected: true` to the rule: ```yaml check: primitive: daw.fragjan.check.pattern pattern: "provides =" match_type: contains skip_comments: true expected: true ``` ## Acceptance criteria - [ ] `init-has-provides` passes for `init.lua` files containing `provides =` - [ ] `init-has-provides` errors for `init.lua` files missing `provides =`
michael added this to the Basic Version milestone 2026-06-04 11:29:28 +02:00
michael 2026-06-04 20:40:31 +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#122
No description provided.