-
Notifications
You must be signed in to change notification settings - Fork 125
Closed
Labels
bugSomething isn't workingSomething isn't workingdevcontainerDevelopment container configurationDevelopment container configuration
Description
Summary
Gitignore pattern matching fails in Linux dev container environments because Get-GitIgnorePatterns uses hardcoded Windows backslash (\) separators instead of platform-appropriate separators.
Problem
When running Validate-MarkdownFrontmatter.ps1 in the Ubuntu-based dev container, gitignore patterns like node_modules/ are converted to *\node_modules\* which never matches Linux file paths like /workspace/node_modules/....
Root Cause
Get-GitIgnorePatternsinLintingHelpers.psm1hardcodes backslash separators- PowerShell's
-likeoperator performs literal string matching - Linux paths use forward slashes, so patterns with backslashes never match
Solution
- Use
[System.IO.Path]::DirectorySeparatorCharfor platform detection - Normalize input patterns by replacing both
/and\with the platform separator - Refactor
Validate-MarkdownFrontmatter.ps1to use the shared helper function (DRY principle)
Files Affected
scripts/linting/Modules/LintingHelpers.psm1- UpdateGet-GitIgnorePatternsfunctionscripts/linting/Validate-MarkdownFrontmatter.ps1- Replace inline parsing with shared function call
Acceptance Criteria
-
node_modules/directory is properly excluded when running in Linux dev container - All gitignore patterns work correctly on both Windows and Linux
- No regression for Windows environments
- Duplicate inline code eliminated
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdevcontainerDevelopment container configurationDevelopment container configuration