Skip to content

Commit 0cb9866

Browse files
committed
Add style check for file names to start with a capital letter or digit
1 parent e7cc802 commit 0cb9866

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

scripts/checks/check-filename-style.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ foreach ($file in $files) {
132132
}
133133
}
134134

135+
if ($baseName -notmatch '^[A-Z0-9]') {
136+
Write-Host "[STYLE][ERROR] $relativePath : file name must start with a capital letter or digit."
137+
Add-Count -Map $ruleCounts -Key "start_upper_or_digit"
138+
$strictErrors++
139+
}
140+
135141
if ($WarnOnUnderscore -and $baseName.Contains("_")) {
136142
Write-Host "[STYLE][WARN] $relativePath : underscore in file name."
137143
Add-Count -Map $ruleCounts -Key "underscore_warning"
@@ -143,6 +149,7 @@ foreach ($file in $files) {
143149
Add-Count -Map $ruleCounts -Key "squashed_warning"
144150
$warningCount++
145151
}
152+
146153
}
147154

148155
Write-Host ""

0 commit comments

Comments
 (0)