aboutsummaryrefslogtreecommitdiff
path: root/scripts/azure-pipelines/windows
diff options
context:
space:
mode:
authornicole mazzuca <mazzucan@outlook.com>2020-12-16 13:14:35 -0800
committerGitHub <noreply@github.com>2020-12-16 13:14:35 -0800
commit30767175d52d9667ce37d96fe1a7d1438dc94ea1 (patch)
tree982999e2593b2d8bc580e25ef9f50f84d30cb6be /scripts/azure-pipelines/windows
parentd52fbe6a45c9ee0736edb42be4d688ae858bc215 (diff)
downloadvcpkg-30767175d52d9667ce37d96fe1a7d1438dc94ea1.tar.gz
vcpkg-30767175d52d9667ce37d96fe1a7d1438dc94ea1.zip
[vcpkg ci] upload diff from clang-format to artifacts (#15141)
* [vcpkg ci] upload diff from clang-format to artifacts this allows people who do not have access to clang-format to format their code via diff
Diffstat (limited to 'scripts/azure-pipelines/windows')
-rw-r--r--scripts/azure-pipelines/windows/Check-CMakeFunctionDocumentation.ps130
-rw-r--r--scripts/azure-pipelines/windows/Check-CxxFormatting.ps155
-rw-r--r--scripts/azure-pipelines/windows/Check-ManifestFormatting.ps149
-rw-r--r--scripts/azure-pipelines/windows/Get-ChangedFiles.ps19
4 files changed, 0 insertions, 143 deletions
diff --git a/scripts/azure-pipelines/windows/Check-CMakeFunctionDocumentation.ps1 b/scripts/azure-pipelines/windows/Check-CMakeFunctionDocumentation.ps1
deleted file mode 100644
index 5505c3401..000000000
--- a/scripts/azure-pipelines/windows/Check-CMakeFunctionDocumentation.ps1
+++ /dev/null
@@ -1,30 +0,0 @@
-[CmdletBinding()]
-Param(
- [Parameter(Mandatory=$True)]
- [string]$Root
-)
-
-if (-not (Test-Path "$Root/.vcpkg-root"))
-{
- Write-Error "The vcpkg root was not at $Root"
- throw
-}
-
-& "$Root/docs/regenerate.ps1" -VcpkgRoot $Root -WarningAction 'Stop'
-
-$changedFiles = & "$PSScriptRoot/Get-ChangedFiles.ps1" -Directory "$Root/docs"
-if ($null -ne $changedFiles)
-{
- $msg = @(
- "",
- "The documentation files do not seem to have been regenerated.",
- "Please re-run `docs/regenerate.ps1`."
- )
- $msg += ""
-
- $msg += "This should produce the following diff:"
- $msg += git diff "$Root/docs"
-
- Write-Error ($msg -join "`n")
- throw
-}
diff --git a/scripts/azure-pipelines/windows/Check-CxxFormatting.ps1 b/scripts/azure-pipelines/windows/Check-CxxFormatting.ps1
deleted file mode 100644
index eaa9e692b..000000000
--- a/scripts/azure-pipelines/windows/Check-CxxFormatting.ps1
+++ /dev/null
@@ -1,55 +0,0 @@
-[CmdletBinding()]
-Param(
- [Parameter(Mandatory=$True)]
- [string]$Root,
- [Parameter()]
- [switch]$IgnoreErrors # allows one to just format
-)
-
-$clangFormat = 'C:\Program Files\LLVM\bin\clang-format.exe'
-if (-not (Test-Path $clangFormat))
-{
- $clangFormat = 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\Llvm\x64\bin\clang-format.exe'
- if (-not (Test-Path $clangFormat))
- {
- Write-Error 'clang-format not found; is it installed in the CI machines?'
- throw
- }
-}
-
-$toolsrc = Get-Item "$Root/toolsrc"
-Push-Location $toolsrc
-
-try
-{
- $files = Get-ChildItem -Recurse -LiteralPath "$toolsrc/src" -Filter '*.cpp'
- $files += Get-ChildItem -Recurse -LiteralPath "$toolsrc/include/vcpkg" -Filter '*.h'
- $files += Get-ChildItem -Recurse -LiteralPath "$toolsrc/include/vcpkg-test" -Filter '*.h'
- $files += Get-Item "$toolsrc/include/pch.h"
- $fileNames = $files.FullName
-
- & $clangFormat -style=file -i @fileNames
-
- $changedFiles = & "$PSScriptRoot/Get-ChangedFiles.ps1" -Directory $toolsrc
- if (-not $IgnoreErrors -and $null -ne $changedFiles)
- {
- $msg = @(
- "",
- "The formatting of the C++ files didn't match our expectation.",
- "See github.com/microsoft/vcpkg/blob/master/docs/maintainers/maintainer-guide.md#vcpkg-internal-code for solution."
- )
- $msg += "File list:"
- $msg += " $changedFiles"
- $msg += ""
-
- $msg += "clang-format should produce the following diff:"
- $msg += git diff $toolsrc
-
- Write-Error ($msg -join "`n")
- throw
- }
-}
-finally
-{
- Pop-Location
-}
diff --git a/scripts/azure-pipelines/windows/Check-ManifestFormatting.ps1 b/scripts/azure-pipelines/windows/Check-ManifestFormatting.ps1
deleted file mode 100644
index 75924c24a..000000000
--- a/scripts/azure-pipelines/windows/Check-ManifestFormatting.ps1
+++ /dev/null
@@ -1,49 +0,0 @@
-[CmdletBinding()]
-Param(
- [Parameter(Mandatory=$True)]
- [string]$Root,
- [Parameter()]
- [switch]$IgnoreErrors # allows one to just format
-)
-
-$portsTree = Get-Item "$Root/ports"
-
-if (-not (Test-Path "$Root/.vcpkg-root"))
-{
- Write-Error "The vcpkg root was not at $Root"
- throw
-}
-
-if (-not (Test-Path "$Root/vcpkg.exe"))
-{
- & "$Root/bootstrap-vcpkg.bat"
- if (-not $?)
- {
- Write-Error "Bootstrapping vcpkg failed"
- throw
- }
-}
-
-& "$Root/vcpkg.exe" 'format-manifest' '--all'
-if (-not $?)
-{
- Write-Error "Failed formatting manifests; are they well-formed?"
- throw
-}
-
-$changedFiles = & "$PSScriptRoot/Get-ChangedFiles.ps1" -Directory $portsTree
-if (-not $IgnoreErrors -and $null -ne $changedFiles)
-{
- $msg = @(
- "",
- "The formatting of the manifest files didn't match our expectation.",
- "See github.com/microsoft/vcpkg/blob/master/docs/maintainers/maintainer-guide.md#manifest for solution."
- )
- $msg += ""
-
- $msg += "vcpkg should produce the following diff:"
- $msg += git diff $portsTree
-
- Write-Error ($msg -join "`n")
- throw
-}
diff --git a/scripts/azure-pipelines/windows/Get-ChangedFiles.ps1 b/scripts/azure-pipelines/windows/Get-ChangedFiles.ps1
deleted file mode 100644
index e299369a0..000000000
--- a/scripts/azure-pipelines/windows/Get-ChangedFiles.ps1
+++ /dev/null
@@ -1,9 +0,0 @@
-[CmdletBinding()]
-Param(
- [Parameter(Mandatory=$True)]
- [string]$Directory
-)
-
-git status --porcelain $Directory | ForEach-Object {
- (-split $_)[1]
-}