fix(runner): is_excluded prefix match incorrectly excludes files #51

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

Problem

is_excluded in runner.lua uses a prefix match:

if rel:sub(1, #ex) == ex then return true end

ex = "test" would exclude test_helpers.lua and test_config.lua,
not just test/ or test/*.lua. Any exclude entry that is a prefix
of a filename will incorrectly exclude that file.

Fix

Prefix match should only trigger on directory separators:

if rel:sub(1, #ex + 1) == ex .. "/" then return true end

Acceptance criteria

  • test does not exclude test_helpers.lua
  • test/ correctly excludes test/foo.lua
## Problem `is_excluded` in `runner.lua` uses a prefix match: ```lua if rel:sub(1, #ex) == ex then return true end ``` `ex = "test"` would exclude `test_helpers.lua` and `test_config.lua`, not just `test/` or `test/*.lua`. Any exclude entry that is a prefix of a filename will incorrectly exclude that file. ## Fix Prefix match should only trigger on directory separators: ```lua if rel:sub(1, #ex + 1) == ex .. "/" then return true end ``` ## Acceptance criteria - [ ] `test` does not exclude `test_helpers.lua` - [ ] `test/` correctly excludes `test/foo.lua`
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#51
No description provided.