Severity: π‘ Medium (code quality)
directives/include.py:48β56 mixes string paths and (inode, dev) tuples in a single _visited: set. Works because both are hashable, but fragile and confusing.
Suggested fix
_visited_paths: set[str] = set()
_visited_inodes: set[tuple[int, int]] = set()
Thread both sets through the recursion. Update the cycle-detection check and the chain-print formatting to be type-aware.
Acceptance criteria
- Refactor passes existing
test_include_cycle tests.
- Add a test: include via two different relative paths that resolve to the same inode β cycle detected and chain prints clearly.
Severity: π‘ Medium (code quality)
directives/include.py:48β56mixes string paths and(inode, dev)tuples in a single_visited: set. Works because both are hashable, but fragile and confusing.Suggested fix
Thread both sets through the recursion. Update the cycle-detection check and the chain-print formatting to be type-aware.
Acceptance criteria
test_include_cycletests.