bug(no-temp-dir-literal): false positive on Lua module name strings containing .temp #119

Closed
opened 2026-06-03 12:52:11 +02:00 by michael · 0 comments
Owner

Problem

The no-temp-dir-literal check fires on Lua module name strings that contain
.temp as part of a namespace segment.

Example

local _NAME = "daw.common.fs.temp" -- fragjan: suppress no-temp-dir-literal
local ok, m = pcall(require, "daw.common.fs.temp") -- fragjan: suppress no-temp-dir-literal

Both lines require a suppress annotation even though neither is a path.
The string "daw.common.fs.temp" is a Lua require path, not a filesystem path.

Expected behavior

no-temp-dir-literal should not fire on strings that match the Lua module
name pattern (word.word.word...). A heuristic: if the string contains no
/ and matches ^[a-z][a-z0-9_.]*$, it is a module name, not a path.

Acceptance criteria

  • no-temp-dir-literal does not fire on "daw.common.fs.temp" or similar
  • Existing test coverage updated
## Problem The `no-temp-dir-literal` check fires on Lua module name strings that contain `.temp` as part of a namespace segment. ## Example ```lua local _NAME = "daw.common.fs.temp" -- fragjan: suppress no-temp-dir-literal local ok, m = pcall(require, "daw.common.fs.temp") -- fragjan: suppress no-temp-dir-literal ``` Both lines require a suppress annotation even though neither is a path. The string `"daw.common.fs.temp"` is a Lua require path, not a filesystem path. ## Expected behavior `no-temp-dir-literal` should not fire on strings that match the Lua module name pattern (`word.word.word...`). A heuristic: if the string contains no `/` and matches `^[a-z][a-z0-9_.]*$`, it is a module name, not a path. ## Acceptance criteria - [ ] `no-temp-dir-literal` does not fire on `"daw.common.fs.temp"` or similar - [ ] Existing test coverage updated
michael added this to the Basic Version milestone 2026-06-04 11:29:28 +02:00
michael 2026-06-04 20:29:24 +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#119
No description provided.