зеркало из https://github.com/microsoft/terminal.git
add audit build step for code formatting check (#1208)
* add audit build step for code formatting check
This commit is contained in:
Родитель
9b92986b49
Коммит
fa36d43b37
|
@ -41,6 +41,12 @@ jobs:
|
||||||
nugetConfigPath: build/config/NuGet.config
|
nugetConfigPath: build/config/NuGet.config
|
||||||
restoreDirectory: '$(Build.SourcesDirectory)/packages'
|
restoreDirectory: '$(Build.SourcesDirectory)/packages'
|
||||||
|
|
||||||
|
- task: PowerShell@2
|
||||||
|
displayName: 'Code Formattting Check'
|
||||||
|
inputs:
|
||||||
|
targetType: filePath
|
||||||
|
filePath: '.\build\scripts\Invoke-FormattingCheck.ps1'
|
||||||
|
|
||||||
- task: VSBuild@1
|
- task: VSBuild@1
|
||||||
displayName: 'Build solution **\OpenConsole.sln'
|
displayName: 'Build solution **\OpenConsole.sln'
|
||||||
inputs:
|
inputs:
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
|
||||||
|
#.SYNOPSIS
|
||||||
|
# Checks for code formatting errors. Will throw exception if any are found.
|
||||||
|
function Invoke-CheckBadCodeFormatting() {
|
||||||
|
Import-Module ./tools/OpenConsole.psm1
|
||||||
|
Invoke-CodeFormat
|
||||||
|
# returns a non-zero exit code if there are any diffs in the tracked files in the repo
|
||||||
|
git diff-index --quiet HEAD --
|
||||||
|
if ($lastExitCode -eq 1) {
|
||||||
|
throw "code formatting bad, run Invoke-CodeFormat on branch"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Invoke-CheckBadCodeFormatting
|
Двоичный файл не отображается.
Загрузка…
Ссылка в новой задаче