forked from dotnet/roslyn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
todo-check.ps1
25 lines (22 loc) · 968 Bytes
/
todo-check.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<#
Checks that TODO and PROTOTYPE comments are not present.
#>
# Verify no PROTOTYPE marker left in main
Set-StrictMode -version 2.0
$ErrorActionPreference="Stop"
if ($env:SYSTEM_PULLREQUEST_TARGETBRANCH -eq "main") {
Write-Host "Checking no PROTOTYPE markers in source"
$prototypes = Get-ChildItem -Path src, eng, scripts -Exclude *.dll,*.exe,*.pdb,*.xlf,todo-check.ps1 -Recurse | Select-String -Pattern 'PROTOTYPE' -CaseSensitive -SimpleMatch
if ($prototypes) {
Write-Host "Found PROTOTYPE markers in source:"
Write-Host $prototypes
throw "PROTOTYPE markers disallowed in compiler source"
}
}
# Verify no TODO2 marker left
$prototypes = Get-ChildItem -Path src, eng, scripts -Exclude *.dll,*.exe,*.pdb,*.xlf,todo-check.ps1 -Recurse | Select-String -Pattern 'TODO2' -CaseSensitive -SimpleMatch
if ($prototypes) {
Write-Host "Found TODO2 markers in source:"
Write-Host $prototypes
throw "TODO2 markers disallowed in compiler source"
}