Browse code

Update validate-lint script

Add a set of newly linted packages, and fix the script.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>

Arnaud Porterie authored on 2015/07/22 06:54:27
Showing 1 changed files
... ...
@@ -4,13 +4,15 @@ source "${MAKEDIR}/.validate"
4 4
 
5 5
 # We will eventually get to the point when packages should be the complete list
6 6
 # of subpackages, vendoring excluded, as given by:
7
-#  go list ./... | grep -v "^github.com/docker/docker/vendor"
7
+#
8
+# packages=( $(go list ./... 2> /dev/null | grep -vE "^github.com/docker/docker/vendor" || true ) )
9
+
8 10
 packages=(
9 11
 	builder/parser/dumper
10 12
 	daemon/events
11 13
 	daemon/execdriver/native/template
14
+	daemon/graphdriver/btrfs
12 15
 	daemon/network
13
-	cliconfig
14 16
 	docker
15 17
 	dockerinit
16 18
 	pkg/chrootarchive
... ...
@@ -19,21 +21,24 @@ packages=(
19 19
 	pkg/homedir
20 20
 	pkg/listenbuffer
21 21
 	pkg/mflag/example
22
+	pkg/namesgenerator
22 23
 	pkg/promise
23 24
 	pkg/pubsub
24 25
 	pkg/random
26
+	pkg/reexec
25 27
 	pkg/symlink
26 28
 	pkg/timeutils
27 29
 	pkg/tlsconfig
28 30
 	pkg/urlutil
29 31
 	pkg/version
32
+	utils
30 33
 )
31 34
 
32 35
 errors=()
33
-for p in "$packages"; do
34
-	failedLint=$(golint "github.com/docker/docker/$p")
36
+for p in "${packages[@]}"; do
37
+	failedLint=$(golint "$p")
35 38
 	if [ "$failedLint" ]; then
36
-		errors+=( "$failedLint"  )
39
+		errors+=( "$failedLint" )
37 40
 	fi
38 41
 done
39 42
 
... ...
@@ -42,7 +47,9 @@ if [ ${#errors[@]} -eq 0 ]; then
42 42
 else
43 43
 	{
44 44
 		echo "Errors from golint:"
45
-		echo "${errors[@]}"
45
+		for err in "${errors[@]}"; do
46
+			echo "$err"
47
+		done
46 48
 		echo
47 49
 		echo 'Please fix the above errors. You can test via "golint" and commit the result.'
48 50
 		echo