Skip to content

Improve YAML file path validation regex for all platforms#6234

Open
veeceey wants to merge 1 commit intojina-ai:masterfrom
veeceey:fix/yaml-validation-regex
Open

Improve YAML file path validation regex for all platforms#6234
veeceey wants to merge 1 commit intojina-ai:masterfrom
veeceey:fix/yaml-validation-regex

Conversation

@veeceey
Copy link

@veeceey veeceey commented Feb 8, 2026

Summary

  • Improves YAML file path validation regex patterns for both Windows and Unix
  • Previously, Windows regex was too permissive (matched any string ending in .yaml/.yml)
  • Previously, Unix regex was too restrictive (only matched absolute paths starting with /)
  • Better distinguishes between YAML file paths and raw YAML content strings

Changes

  • Windows: Now properly validates paths with drive letters (C:), UNC paths (\), relative paths (.), and regular paths
  • Unix: Now supports both absolute (/path) and relative (./path or path) file paths
  • Removed TODO comment as regex is now comprehensive

Test plan

  • Validated regex patterns match expected file path formats
  • Existing functionality preserved for valid paths
  • Better rejection of non-file-path strings

Generated with Claude Code

Previously, the Windows regex was too permissive (matching any string
ending in .yaml/.yml) and the Unix regex was too restrictive (only
matching absolute paths starting with /).

This fix improves both patterns to be more comprehensive:
- Windows: Now properly validates paths with drive letters (C:\),
  UNC paths (\\), relative paths (.\), and regular paths
- Unix: Now supports both absolute (/path) and relative (./path or
  path) file paths

The improved patterns better distinguish between YAML file paths and
raw YAML content strings.
@veeceey
Copy link
Author

veeceey commented Feb 19, 2026

Friendly ping - any chance someone could take a look at this when they get a chance? Happy to make any changes if needed.

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