mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Golint only on changed files
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
6733962a2c
commit
1cca5ee98c
1 changed files with 6 additions and 7 deletions
|
@ -2,15 +2,14 @@
|
||||||
|
|
||||||
source "${MAKEDIR}/.validate"
|
source "${MAKEDIR}/.validate"
|
||||||
|
|
||||||
packages=( $(go list ./... 2> /dev/null | grep -vE "^github.com/docker/docker/vendor|^github.com/docker/docker/autogen" || true ) )
|
IFS=$'\n'
|
||||||
|
files=( $(validate_diff --diff-filter=ACMR --name-only -- '*.go' | grep -v '^vendor/' || true) )
|
||||||
|
unset IFS
|
||||||
|
|
||||||
errors=()
|
errors=()
|
||||||
for p in "${packages[@]}"; do
|
for f in "${files[@]}"; do
|
||||||
# Remove the github.com/docker/docker/ prefix from listed package
|
# we use "git show" here to validate that what's committed passes go vet
|
||||||
package="${p#github.com/docker/docker/}"
|
failedLint=$(golint "$f")
|
||||||
# Run golint on package/*.go file explicitly to validate all go files
|
|
||||||
# and not just the ones for the current platform.
|
|
||||||
failedLint=$(golint $package/*.go)
|
|
||||||
if [ "$failedLint" ]; then
|
if [ "$failedLint" ]; then
|
||||||
errors+=( "$failedLint" )
|
errors+=( "$failedLint" )
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue