Parcourir la source

Merge pull request #14833 from icecrime/14756_update_lint_script

Update validate-lint script
Tibor Vass il y a 10 ans
Parent
commit
879f440a99
1 fichiers modifiés avec 13 ajouts et 6 suppressions
  1. 13 6
      hack/make/validate-lint

+ 13 - 6
hack/make/validate-lint

@@ -4,13 +4,15 @@ source "${MAKEDIR}/.validate"
 
 
 # We will eventually get to the point when packages should be the complete list
 # We will eventually get to the point when packages should be the complete list
 # of subpackages, vendoring excluded, as given by:
 # of subpackages, vendoring excluded, as given by:
-#  go list ./... | grep -v "^github.com/docker/docker/vendor"
+#
+# packages=( $(go list ./... 2> /dev/null | grep -vE "^github.com/docker/docker/vendor" || true ) )
+
 packages=(
 packages=(
 	builder/parser/dumper
 	builder/parser/dumper
 	daemon/events
 	daemon/events
 	daemon/execdriver/native/template
 	daemon/execdriver/native/template
+	daemon/graphdriver/btrfs
 	daemon/network
 	daemon/network
-	cliconfig
 	docker
 	docker
 	dockerinit
 	dockerinit
 	pkg/chrootarchive
 	pkg/chrootarchive
@@ -19,21 +21,24 @@ packages=(
 	pkg/homedir
 	pkg/homedir
 	pkg/listenbuffer
 	pkg/listenbuffer
 	pkg/mflag/example
 	pkg/mflag/example
+	pkg/namesgenerator
 	pkg/promise
 	pkg/promise
 	pkg/pubsub
 	pkg/pubsub
 	pkg/random
 	pkg/random
+	pkg/reexec
 	pkg/symlink
 	pkg/symlink
 	pkg/timeutils
 	pkg/timeutils
 	pkg/tlsconfig
 	pkg/tlsconfig
 	pkg/urlutil
 	pkg/urlutil
 	pkg/version
 	pkg/version
+	utils
 )
 )
 
 
 errors=()
 errors=()
-for p in "$packages"; do
-	failedLint=$(golint "github.com/docker/docker/$p")
+for p in "${packages[@]}"; do
+	failedLint=$(golint "$p")
 	if [ "$failedLint" ]; then
 	if [ "$failedLint" ]; then
-		errors+=( "$failedLint"  )
+		errors+=( "$failedLint" )
 	fi
 	fi
 done
 done
 
 
@@ -42,7 +47,9 @@ if [ ${#errors[@]} -eq 0 ]; then
 else
 else
 	{
 	{
 		echo "Errors from golint:"
 		echo "Errors from golint:"
-		echo "${errors[@]}"
+		for err in "${errors[@]}"; do
+			echo "$err"
+		done
 		echo
 		echo
 		echo 'Please fix the above errors. You can test via "golint" and commit the result.'
 		echo 'Please fix the above errors. You can test via "golint" and commit the result.'
 		echo
 		echo