feat(rules): add rule to enforce init.lua convention for modules with submodules #98

Closed
opened 2026-05-30 11:01:36 +02:00 by michael · 1 comment
Owner

Problem

Modules that have submodules are sometimes structured as module.lua
instead of module/init.lua. The init.lua convention allows
submodules to live naturally alongside the entry point.

Expected behaviour

fragjan should warn when a module file exists as name.lua but a
corresponding name/ directory also exists, suggesting it should be
name/init.lua.

Or alternatively: define a project-level convention that all modules
with submodules must use init.lua as entry point.

Context

Introduced during DAW/fragjan#43 refactor when core/runner.lua was
split into core/runner/init.lua, core/runner/project.lua and
core/runner/file.lua.

Affected files

  • new rule in var/rules/daw-lua-architecture/

See also

## Problem Modules that have submodules are sometimes structured as `module.lua` instead of `module/init.lua`. The `init.lua` convention allows submodules to live naturally alongside the entry point. ## Expected behaviour fragjan should warn when a module file exists as `name.lua` but a corresponding `name/` directory also exists, suggesting it should be `name/init.lua`. Or alternatively: define a project-level convention that all modules with submodules must use `init.lua` as entry point. ## Context Introduced during DAW/fragjan#43 refactor when `core/runner.lua` was split into `core/runner/init.lua`, `core/runner/project.lua` and `core/runner/file.lua`. ## Affected files - new rule in `var/rules/daw-lua-architecture/` ## See also - DAW/fragjan#43 (runner split -- motivation for this rule)
michael added this to the Basic Version milestone 2026-05-30 16:08:42 +02:00
Author
Owner

Completed

  • filehassiblingdir primitive implemented (DAW/daw-modul-fragjan-check-filehassiblingdir 0.1.1)
  • file-has-sibling-dir rule added to daw-lua-architecture pack
  • Known violation in fragjan: core/commands.lua -- to be refactored
## Completed - filehassiblingdir primitive implemented (DAW/daw-modul-fragjan-check-filehassiblingdir 0.1.1) - file-has-sibling-dir rule added to daw-lua-architecture pack - Known violation in fragjan: core/commands.lua -- to be refactored
michael 2026-05-31 16:13:34 +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#98
No description provided.