Skip to content

Commit a2c4cfb

Browse files
🩹 [Patch]: Normalize path separators in PSScriptAnalyzer tests (#11)
## Description This pull request includes a minor change to the `PSScriptAnalyzer.Tests.ps1` file. The change ensures that backslashes are replaced with forward slashes in the paths, improving consistency in path formatting. * [`scripts/tests/PSScriptAnalyzer/PSScriptAnalyzer.Tests.ps1`](diffhunk://#diff-506030604c5eac4d6d266aa14f0e8cf3a8121425c1f579406e3a003d5b091ac9L77-R79): Modified the path normalization logic to replace backslashes with forward slashes. ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [x] 🪲 [Fix] - [ ] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent 65f7758 commit a2c4cfb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/tests/PSScriptAnalyzer/PSScriptAnalyzer.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ Describe 'PSScriptAnalyzer' {
7474
}
7575
$Path = Resolve-Path -Path $Path | Select-Object -ExpandProperty Path
7676
$relativePath = if ($Path.StartsWith($PSScriptRoot)) {
77-
$Path.Replace($PSScriptRoot, 'Action:').Trim('\').Trim('/')
77+
$Path.Replace($PSScriptRoot, 'Action:').Trim('\').Trim('/').Replace('\', '/')
7878
} elseif ($Path.StartsWith($env:GITHUB_WORKSPACE)) {
79-
$Path.Replace($env:GITHUB_WORKSPACE, 'Workspace:').Trim('\').Trim('/')
79+
$Path.Replace($env:GITHUB_WORKSPACE, 'Workspace:').Trim('\').Trim('/').Replace('\', '/')
8080
} else {
8181
$Path
8282
}

0 commit comments

Comments
 (0)