Skip to content

chore(tools): Validate path before format arguments in fs_create_file#641

Merged
JeanMertz merged 2 commits into
mainfrom
prr211
May 16, 2026
Merged

chore(tools): Validate path before format arguments in fs_create_file#641
JeanMertz merged 2 commits into
mainfrom
prr211

Conversation

@JeanMertz
Copy link
Copy Markdown
Collaborator

Path validation (absolute path, component length, component count) was
previously skipped during the format-arguments phase, meaning invalid
paths could pass through undetected until actual execution. The checks
are now hoisted above the is_format_arguments branch so they apply
consistently in both phases.

The "Created file" preview message was also corrected to "Creating file"
to better reflect that the format phase is showing intent, not reporting
a completed action.

A test covering the absolute-path rejection during the format phase was
added to guard against regressions.

Path validation (absolute path, component length, component count) was
previously skipped during the format-arguments phase, meaning invalid
paths could pass through undetected until actual execution. The checks
are now hoisted above the `is_format_arguments` branch so they apply
consistently in both phases.

The "Created file" preview message was also corrected to "Creating file"
to better reflect that the format phase is showing intent, not reporting
a completed action.

A test covering the absolute-path rejection during the format phase was
added to guard against regressions.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz JeanMertz changed the base branch from prr210 to main May 15, 2026 21:40
…ate_file`

Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz JeanMertz merged commit 07da8f6 into main May 16, 2026
14 checks passed
@JeanMertz JeanMertz deleted the prr211 branch May 16, 2026 06:30
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.

1 participant