Merge pull request #44296 from corhere/narrow-pkg-imports-validator
hack: allow pkg/ to import internal/ packages
This commit is contained in:
commit
40429857c3
2 changed files with 7 additions and 1 deletions
|
@ -263,6 +263,7 @@ Function Validate-PkgImports($headCommit, $upstreamCommit) {
|
|||
# Filter out what we are looking for
|
||||
$imports = @() + $imports -NotMatch "^github.com/docker/docker/pkg/" `
|
||||
-NotMatch "^github.com/docker/docker/vendor" `
|
||||
-NotMatch "^github.com/docker/docker/internal" `
|
||||
-Match "^github.com/docker/docker" `
|
||||
-Replace "`n", ""
|
||||
$imports | ForEach-Object{ $badFiles+="$file imports $_`n" }
|
||||
|
|
|
@ -11,7 +11,12 @@ unset IFS
|
|||
badFiles=()
|
||||
for f in "${files[@]}"; do
|
||||
IFS=$'\n'
|
||||
badImports=($(go list -e -f '{{ join .Deps "\n" }}' "$f" | sort -u | grep -vE '^github.com/docker/docker/pkg/' | grep -vE '^github.com/docker/docker/vendor' | grep -E '^github.com/docker/docker' || true))
|
||||
badImports=($(go list -e -f '{{ join .Deps "\n" }}' "$f" | sort -u \
|
||||
| grep -vE '^github.com/docker/docker/pkg/' \
|
||||
| grep -vE '^github.com/docker/docker/vendor' \
|
||||
| grep -vE '^github.com/docker/docker/internal' \
|
||||
| grep -E '^github.com/docker/docker' \
|
||||
|| true))
|
||||
unset IFS
|
||||
|
||||
for import in "${badImports[@]}"; do
|
||||
|
|
Loading…
Reference in a new issue