rule: detect require() calls that do not load daw.mainjan #129
Labels
No labels
coordination/cross-repo
coordination/needed
effort
large
effort
medium
effort
small
meta/duplicate
meta/planning
meta/wontfix
priority
high
priority
low
priority
medium
session
blocker
session
handover
session
next
status
blocked
status
done
status
in-progress
status
review
status
to-go
type
admin
type/architecture
type
bug
type
config
type
deployment
type
docs
type/documentation
type
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
type
research
type
security
type/task
type/tech-debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DAW/fragjan#129
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
A fragjan rule that detects all require() calls in a file that do not
load daw.mainjan -- making invisible static coupling visible.
Background
DAW architecture: require() is only permitted for daw.mainjan.
All other capabilities are resolved via m:ask(). Violations are easy
to miss in review -- a dedicated rule makes them unforgeable.
Expected behavior
Flags every require() call where the argument is not "daw.mainjan":
Rule definition (sketch)
Notes
visible before they reach review
Done
Rule implemented in daw-lua-architecture pack using daw.fragjan.check.linepattern
with exclude_if_contains: 'daw.mainjan'.
Tested against DAW/fragjan: 128 errors found across 26 files.
Tested against DAW/daw-lua-mainjan: 6 errors found -- confirmed working.
Note: regex match_type in daw.fragjan.check.pattern does not support
Lua-incompatible syntax (no lookahead). linepattern is the correct primitive.