feat: implement filehassiblingdir primitive #103

Closed
opened 2026-05-31 15:42:18 +02:00 by michael · 1 comment
Owner

Goal

Add a filehassiblingdir primitive that checks whether a file has a
sibling directory with the same name (without extension).

Motivation

Enables DAW/fragjan#98: detect modules structured as name.lua when
a name/ directory exists alongside it -- suggesting it should be
name/init.lua instead.

Behaviour

  • target: { type = "file", path = "..." }
  • Extracts filename without extension (e.g. "runner" from "runner.lua")
  • Checks if a directory with that name exists in the same parent directory
  • Returns: status = "warn" if sibling dir exists, "pass" otherwise

Acceptance Criteria

  • filehassiblingdir primitive implemented
  • filesystem = "read"
  • Returns warn if sibling directory exists
  • Returns pass if no sibling directory
  • DAW/fragjan#98 unblocked
## Goal Add a `filehassiblingdir` primitive that checks whether a file has a sibling directory with the same name (without extension). ## Motivation Enables DAW/fragjan#98: detect modules structured as `name.lua` when a `name/` directory exists alongside it -- suggesting it should be `name/init.lua` instead. ## Behaviour - target: { type = "file", path = "..." } - Extracts filename without extension (e.g. "runner" from "runner.lua") - Checks if a directory with that name exists in the same parent directory - Returns: status = "warn" if sibling dir exists, "pass" otherwise ## Acceptance Criteria - [ ] filehassiblingdir primitive implemented - [ ] filesystem = "read" - [ ] Returns warn if sibling directory exists - [ ] Returns pass if no sibling directory - [ ] DAW/fragjan#98 unblocked ## Related - DAW/fragjan#98 (init.lua convention rule)
Author
Owner

Completed in v0.1.1

  • check() warns if sibling directory with same name exists alongside file
  • filesystem = "read", api_version = 1
  • 13 tests covering sibling found, not found, no extension, error cases
  • Unblocks DAW/fragjan#98
## Completed in v0.1.1 - check() warns if sibling directory with same name exists alongside file - filesystem = "read", api_version = 1 - 13 tests covering sibling found, not found, no extension, error cases - Unblocks DAW/fragjan#98
michael 2026-05-31 16:15:02 +02:00
michael added this to the Basic Version milestone 2026-05-31 16:48:47 +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#103
No description provided.