mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
hack/validate: remove obsolete exception
This was added in 20d594fb79, but was
written before the API module was added. Now that the API is a separate
module, the check will no longer flag packages importing the API.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -256,15 +256,6 @@ Function Validate-PkgImports($headCommit, $upstreamCommit) {
|
||||
$files=@(); $files = Invoke-Expression "git diff $upstreamCommit...$headCommit --diff-filter=ACMR --name-only -- `'pkg\*.go`'"
|
||||
$badFiles=@(); $files | ForEach-Object{
|
||||
$file=$_
|
||||
|
||||
if ($file -like "pkg\stdcopy\*") {
|
||||
# Temporarily allow pkg/stdcopy to import "github.com/moby/moby/api/stdcopy",
|
||||
# because it's an alias for backward-compatibility.
|
||||
#
|
||||
# TODO(thaJeztah): remove once "github.com/docker/docker/pkg/stdcopy" is removed.
|
||||
return
|
||||
}
|
||||
|
||||
# For the current changed file, get its list of dependencies, sorted and uniqued.
|
||||
$imports = Invoke-Expression "go list -e -f `'{{ .Deps }}`' $file"
|
||||
if ($LASTEXITCODE -ne 0) { Throw "Failed go list for dependencies on $file" }
|
||||
|
||||
@@ -10,16 +10,6 @@ unset IFS
|
||||
|
||||
badFiles=()
|
||||
for f in "${files[@]}"; do
|
||||
case "$f" in
|
||||
pkg/stdcopy/*)
|
||||
# Temporarily allow pkg/stdcopy to import "github.com/moby/moby/api/stdcopy",
|
||||
# because it's an alias for backward-compatibility.
|
||||
#
|
||||
# TODO(thaJeztah): remove once "github.com/docker/docker/pkg/stdcopy" is removed.
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
|
||||
IFS=$'\n'
|
||||
badImports=($(go list -e -f '{{ join .Deps "\n" }}' "$f" | sort -u \
|
||||
| grep -vE '^github.com/docker/docker/pkg/' \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package stdcopy // Deprecated: use [github.com/docker/docker/api/stdcopy] instead.
|
||||
package stdcopy // Deprecated: use [github.com/moby/moby/api/stdcopy] instead.
|
||||
|
||||
import (
|
||||
"io"
|
||||
@@ -6,8 +6,6 @@ import (
|
||||
"github.com/moby/moby/api/stdcopy"
|
||||
)
|
||||
|
||||
// TODO(thaJeztah): remove exception in hack/make.ps1 and hack/validate/pkg-imports when removing.
|
||||
|
||||
// StdType is the type of standard stream
|
||||
// a writer can multiplex to.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user