Skip to content

fix: reject conflicting output file and directory paths - #374

Merged
rowkav09 merged 1 commit into
mainfrom
fix/finalize-conflicting-paths
Oct 5, 2026
Merged

rowkav09 merged 1 commit into
mainfrom
fix/finalize-conflicting-paths

Conversation

@rowkav09

@rowkav09 rowkav09 commented Oct 5, 2026

Copy link
Copy Markdown
Member

finalize checked each file path on its own and then cleaned the output directory, so a layout where one file path is also the parent directory of another (sub and sub/nested.txt) wiped the existing output and then failed on write. I now validate the whole layout before cleaning or writing and reject it with a "conflicting output paths" error.

The new test uses that layout with clean: true, expects the error, and checks an existing file in the output is untouched. It fails on main and passes with the change. Full suite passes, typecheck passes.

Closes #373.

I validate the complete output layout before cleaning or writing so a
file path cannot also be a directory needed by another generated file.

I added a fail-first regression that preserves existing output on error.
@rowkav09
rowkav09 merged commit ae5900e into main Oct 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

finalize with clean erases output before failing on a file that is also a directory

1 participant