Cleanup: loader dead branch and non-table YAML root #138

Open
opened 2026-10-13 05:46:55 +02:00 by michael · 0 comments
Owner

Findings (pre-existing, found during #136)

  • core/loader.lua load_pack(): second if not rule then after
    return nil, rerr is unreachable
  • validate_pack() / parse_yaml() callers index data.schema
    without type(data) == "table"; a YAML scalar number or boolean
    crashes instead of returning nil, err

Acceptance criteria

  • Dead branch removed
  • Non-table YAML root rejected with a clear error (exit 10)
  • Tests for both

Refs: DAW/fragjan#136

## Findings (pre-existing, found during #136) - `core/loader.lua` `load_pack()`: second `if not rule then` after `return nil, rerr` is unreachable - `validate_pack()` / `parse_yaml()` callers index `data.schema` without `type(data) == "table"`; a YAML scalar number or boolean crashes instead of returning `nil, err` ## Acceptance criteria - [ ] Dead branch removed - [ ] Non-table YAML root rejected with a clear error (exit 10) - [ ] Tests for both Refs: DAW/fragjan#136
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#138
No description provided.