1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

remove bonus whitespace

Signed-off-by: Michael Friis <friism@gmail.com>
(cherry picked from commit 8d47858f96)
Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
Michael Friis 2016-12-05 20:21:25 -08:00 committed by Victor Vieux
parent c027e4a861
commit 6e08e2edcf

View file

@ -6,17 +6,17 @@
by hack\make.sh, but uses native Windows PowerShell semantics. It does by hack\make.sh, but uses native Windows PowerShell semantics. It does
not support the full set of options provided by the Linux counterpart. not support the full set of options provided by the Linux counterpart.
For example: For example:
- You can't cross-build Linux docker binaries on Windows - You can't cross-build Linux docker binaries on Windows
- Hashes aren't generated on binaries - Hashes aren't generated on binaries
- 'Releasing' isn't supported. - 'Releasing' isn't supported.
- Integration tests. This is because they currently cannot run inside a container, - Integration tests. This is because they currently cannot run inside a container,
and require significant external setup. and require significant external setup.
It does however provided the minimum necessary to support parts of local Windows It does however provided the minimum necessary to support parts of local Windows
development and Windows to Windows CI. development and Windows to Windows CI.
Usage Examples (run from repo root): Usage Examples (run from repo root):
"hack\make.ps1 -Binary" to build the binaries "hack\make.ps1 -Binary" to build the binaries
"hack\make.ps1 -Client" to build just the client 64-bit binary "hack\make.ps1 -Client" to build just the client 64-bit binary
"hack\make.ps1 -TestUnit" to run unit tests "hack\make.ps1 -TestUnit" to run unit tests
@ -190,7 +190,7 @@ Function Validate-DCO($headCommit, $upstreamCommit) {
# Counts of adds and deletes after removing multiple white spaces. AWK anyone? :( # Counts of adds and deletes after removing multiple white spaces. AWK anyone? :(
$adds=0; $dels=0; $($counts -replace '\s+', ' ') | %{ $a=$_.Split(" "); $adds+=[int]$a[0]; $dels+=[int]$a[1] } $adds=0; $dels=0; $($counts -replace '\s+', ' ') | %{ $a=$_.Split(" "); $adds+=[int]$a[0]; $dels+=[int]$a[1] }
if (($adds -eq 0) -and ($dels -eq 0)) { if (($adds -eq 0) -and ($dels -eq 0)) {
Write-Warning "DCO validation - nothing to validate!" Write-Warning "DCO validation - nothing to validate!"
return return
} }
@ -199,7 +199,7 @@ Function Validate-DCO($headCommit, $upstreamCommit) {
if ($LASTEXITCODE -ne 0) { Throw "Failed git log --format" } if ($LASTEXITCODE -ne 0) { Throw "Failed git log --format" }
$commits = $($commits -split '\s+' -match '\S') $commits = $($commits -split '\s+' -match '\S')
$badCommits=@() $badCommits=@()
$commits | %{ $commits | %{
# Skip commits with no content such as merge commits etc # Skip commits with no content such as merge commits etc
if ($(git log -1 --format=format: --name-status $_).Length -gt 0) { if ($(git log -1 --format=format: --name-status $_).Length -gt 0) {
# Ignore exit code on next call - always process regardless # Ignore exit code on next call - always process regardless
@ -230,7 +230,7 @@ Function Validate-PkgImports($headCommit, $upstreamCommit) {
# For the current changed file, get its list of dependencies, sorted and uniqued. # For the current changed file, get its list of dependencies, sorted and uniqued.
$imports = Invoke-Expression "go list -e -f `'{{ .Deps }}`' $file" $imports = Invoke-Expression "go list -e -f `'{{ .Deps }}`' $file"
if ($LASTEXITCODE -ne 0) { Throw "Failed go list for dependencies on $file" } if ($LASTEXITCODE -ne 0) { Throw "Failed go list for dependencies on $file" }
$imports = $imports -Replace "\[" -Replace "\]", "" -Split(" ") | Sort-Object | Get-Unique $imports = $imports -Replace "\[" -Replace "\]", "" -Split(" ") | Sort-Object | Get-Unique
# Filter out what we are looking for # Filter out what we are looking for
$imports = $imports -NotMatch "^github.com/docker/docker/pkg/" ` $imports = $imports -NotMatch "^github.com/docker/docker/pkg/" `
-NotMatch "^github.com/docker/docker/vendor" ` -NotMatch "^github.com/docker/docker/vendor" `
@ -255,11 +255,11 @@ Function Validate-GoFormat($headCommit, $upstreamCommit) {
if ($(Get-Command gofmt -ErrorAction SilentlyContinue) -eq $nil) { Throw "gofmt does not appear to be installed" } if ($(Get-Command gofmt -ErrorAction SilentlyContinue) -eq $nil) { Throw "gofmt does not appear to be installed" }
# Get a list of all go source-code files which have changed. Ignore exit code on next call - always process regardless # Get a list of all go source-code files which have changed. Ignore exit code on next call - always process regardless
$files=@(); $files = Invoke-Expression "git diff $upstreamCommit...$headCommit --diff-filter=ACMR --name-only -- `'*.go`'" $files=@(); $files = Invoke-Expression "git diff $upstreamCommit...$headCommit --diff-filter=ACMR --name-only -- `'*.go`'"
$files = $files | Select-String -NotMatch "^vendor/" $files = $files | Select-String -NotMatch "^vendor/"
$badFiles=@(); $files | %{ $badFiles=@(); $files | %{
# Deliberately ignore error on next line - treat as failed # Deliberately ignore error on next line - treat as failed
$content=Invoke-Expression "git show $headCommit`:$_" $content=Invoke-Expression "git show $headCommit`:$_"
# Next set of hoops are to ensure we have LF not CRLF semantics as otherwise gofmt on Windows will not succeed. # Next set of hoops are to ensure we have LF not CRLF semantics as otherwise gofmt on Windows will not succeed.
# Also note that gofmt on Windows does not appear to support stdin piping correctly. Hence go through a temporary file. # Also note that gofmt on Windows does not appear to support stdin piping correctly. Hence go through a temporary file.
@ -327,7 +327,7 @@ Try {
# Get the version of docker (eg 1.14.0-dev) # Get the version of docker (eg 1.14.0-dev)
$dockerVersion=Get-DockerVersion $dockerVersion=Get-DockerVersion
# Give a warning if we are not running in a container and are building binaries or running unit tests. # Give a warning if we are not running in a container and are building binaries or running unit tests.
# Not relevant for validation tests as these are fine to run outside of a container. # Not relevant for validation tests as these are fine to run outside of a container.
if ($Client -or $Daemon -or $TestUnit) { Check-InContainer } if ($Client -or $Daemon -or $TestUnit) { Check-InContainer }
@ -341,7 +341,7 @@ Try {
Catch [Exception] { Throw $_ } Catch [Exception] { Throw $_ }
} }
# DCO, Package import and Go formatting tests. # DCO, Package import and Go formatting tests.
if ($DCO -or $PkgImports -or $GoFormat) { if ($DCO -or $PkgImports -or $GoFormat) {
# We need the head and upstream commits for these # We need the head and upstream commits for these
$headCommit=Get-HeadCommit $headCommit=Get-HeadCommit