fix(detect): invalid project type silently ignored in detect_type #53

Closed
opened 2026-05-25 14:36:00 +02:00 by michael · 0 comments
Owner

Problem

M.detect_type in core/detect.lua silently skips an invalid type:

if M.is_valid_type(canonical) then return canonical end

If the type is normalised but not valid, execution falls through to
"no project type found" -- the invalid value is never shown to the user.

Fix

Return an explicit error when type is known but invalid:

if not M.is_valid_type(canonical) then
  return nil, "[ERROR] detect: unknown project type '" .. canonical .. "'"
end
return canonical

Acceptance criteria

  • Invalid type produces [ERROR] naming the value
  • User knows what to fix
## Problem `M.detect_type` in `core/detect.lua` silently skips an invalid type: ```lua if M.is_valid_type(canonical) then return canonical end ``` If the type is normalised but not valid, execution falls through to "no project type found" -- the invalid value is never shown to the user. ## Fix Return an explicit error when type is known but invalid: ```lua if not M.is_valid_type(canonical) then return nil, "[ERROR] detect: unknown project type '" .. canonical .. "'" end return canonical ``` ## Acceptance criteria - [ ] Invalid type produces [ERROR] naming the value - [ ] User knows what to fix
michael added this to the Basic Version milestone 2026-05-30 16:05:00 +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#53
No description provided.