diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 48690528fc45a..9375997c9956b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -209,6 +209,16 @@ jobs: publishLocation: Container condition: succeeded() +- job: Correctness_TodoCheck + pool: + vmImage: ubuntu-20.04 + timeoutInMinutes: 10 + steps: + - template: eng/pipelines/checkout-unix-task.yml + + - pwsh: eng/todo-check.ps1 + displayName: Validate TODO/PROTOTYPE comments are not present + - job: Correctness_Rebuild pool: name: NetCore1ESPool-Public diff --git a/eng/test-build-correctness.ps1 b/eng/test-build-correctness.ps1 index 082207feceb7a..31f62351d1402 100644 --- a/eng/test-build-correctness.ps1 +++ b/eng/test-build-correctness.ps1 @@ -42,25 +42,6 @@ try { New-ItemProperty -Path $key -Name 'DumpFolder' -PropertyType 'String' -Value $LogDir -Force } - # Verify no PROTOTYPE marker left in main - 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,test-build-correctness.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,test-build-correctness.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" - } - Write-Host "Building Roslyn" Exec-Block { & (Join-Path $PSScriptRoot "build.ps1") -restore -build -bootstrap -bootstrapConfiguration:Debug -ci:$ci -runAnalyzers:$true -configuration:$configuration -pack -binaryLog -useGlobalNuGetCache:$false -warnAsError:$true -properties "/p:RoslynEnforceCodeStyle=true"} diff --git a/eng/todo-check.ps1 b/eng/todo-check.ps1 new file mode 100644 index 0000000000000..6f0ead3ddbed4 --- /dev/null +++ b/eng/todo-check.ps1 @@ -0,0 +1,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" +} +