1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/hack/make/validate-lint
Ben Firshman 6b3c928140 Fix golint warnings for integration-cli
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2015-07-22 14:03:50 +01:00

59 lines
1.1 KiB
Bash

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