Skip to content

Commit 07a0c70

Browse files
committed
The "Windows Safety" Check
1 parent 0cb9866 commit 07a0c70

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/checks/check-filename-style.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ foreach ($file in $files) {
103103
$relativePath = Get-RepoRelativePath -Path $file
104104
$baseName = [System.IO.Path]::GetFileNameWithoutExtension($file)
105105

106+
if ($relativePath.Length -ge 180) {
107+
Write-Host "[STYLE][ERROR] $relativePath : path is too long ($($relativePath.Length) chars). Keep under 180 to avoid Windows unzip errors."
108+
Add-Count -Map $ruleCounts -Key "path_too_long"
109+
$strictErrors++
110+
}
111+
106112
if ($relativePath -match '[^\x00-\x7F]') {
107113
Write-Host "[STYLE][ERROR] $relativePath : non-ASCII character in path."
108114
Add-Count -Map $ruleCounts -Key "non_ascii_path"

0 commit comments

Comments
 (0)