From bd398847ba4647bb6a5002adcbb08f37dde73db2 Mon Sep 17 00:00:00 2001 From: Julian Kornberger Date: Sun, 13 May 2018 21:07:48 +0200 Subject: [PATCH] Ignore vendor/ for CI --- .test-coverage | 5 ++++- .travis.gofmt.sh | 2 +- .travis.yml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.test-coverage b/.test-coverage index fa1ec5a..cc6efbf 100755 --- a/.test-coverage +++ b/.test-coverage @@ -12,7 +12,7 @@ echo "mode: count" > profile.cov FAIL=0 # Standard go tooling behavior is to ignore dirs with leading underscors -for dir in $(find . -maxdepth 10 -not -path './.git*' -not -path '*/_*' -type d); +for dir in $(find . -maxdepth 10 -not -path './.git*' -not -path '*/_*' -type d | grep -v '^./vendor/'); do if ls $dir/*.go &> /dev/null; then go test -v -covermode=count -coverprofile=profile.tmp $dir || FAIL=$? @@ -33,6 +33,9 @@ fi # Test if every package has testfiles for dir in $(find . -name "*.go" -printf '%h\0'| sort -zu | sed -z 's/$/\n/'); do + # ignore ./vendor/ completely + [[ $dir == ./vendor/* ]] && continue + if [ "$(ls $dir/*_test.go 2> /dev/null | wc -l)" -eq "0" ]; then echo -n "no test files for $dir"; case $dir in diff --git a/.travis.gofmt.sh b/.travis.gofmt.sh index df102ac..4a1c0b2 100755 --- a/.travis.gofmt.sh +++ b/.travis.gofmt.sh @@ -1,6 +1,6 @@ #!/bin/bash -result="$(gofmt -s -l .)" +result="$(gofmt -s -l . | grep -v '^vendor/' )" if [ -n "$result" ]; then echo "Go code is not formatted, run 'gofmt -s -w .'" >&2 echo "$result" diff --git a/.travis.yml b/.travis.yml index 2fd6112..344557c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,5 +11,5 @@ install: script: - ./.test-coverage travis-ci - ./.travis.gofmt.sh - - misspell -error . + - find . -type f -name '*.go' | grep -v '^./vendor/' | xargs misspell -error - go install github.com/FreifunkBremen/yanic