Azure / Azure/azure-sdk-tools

CSpell Script Path Resolution can fail on Existing Files

Open
#5,679 1 comment 0 reactions 1 assignee Claimed by @danieljurek View on GitHub
Central-EngSys
Dominant language
C#
Stars
135
Forks
260
Avg merge
1d 22h
Merged PRs (30d)
115

Description

While regenerating `session-records` in the Java repository during migration to use Test Proxy I found that path resolution in the CSpell checking script was failing on files that do exist.

image

These path resolution failures do not cause the script to fail, the script will only fail if there are spelling errors. In the case of my PR all files failing path resolution fortunately would be ignored by CSpell as they are excluded, though I don't know if this can be guaranteed. A possible reason for this issue is that Java `session-records` include multiple `.`s in the last file segment and may include `[` and `]` if the test is parameterized. Reviewing documentation of `Resolve-Path`, what is being used in the script to perform path resolution, it may be a case where these characters are being treated as path regular expressions.

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/resolve-path?view=powershell-7.3#example-6-resolve-a-path-containing-brackets

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.