Skip to content

Commit

Permalink
Fix verify scripts to support vendor directory
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf committed May 10, 2016
1 parent 9ef036b commit 7425d4f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ language: go

matrix:
include:
- go: 1.4.3
- go: 1.5.3
- go: 1.6

install:
Expand Down
2 changes: 1 addition & 1 deletion hack/boilerplate/boilerplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def file_passes(filename, refs, regexs):
def file_extension(filename):
return os.path.splitext(filename)[1].split(".")[-1].lower()

skipped_dirs = ['Godeps', 'third_party', '_output', '.git']
skipped_dirs = ['Godeps', 'third_party', '_output', '.git', 'vendor']
def normalize_files(files):
newfiles = []
for pathname in files:
Expand Down
4 changes: 3 additions & 1 deletion hack/verify-flags-underscore.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def get_all_files(rootdir):
files.remove('exceptions.txt')
if 'known-flags.txt' in files:
files.remove('known-flags.txt')
if 'vendor' in dirs:
dirs.remove('vendor')

for name in files:
if name.endswith(".svg"):
Expand All @@ -77,7 +79,7 @@ def get_all_files(rootdir):

def normalize_files(rootdir, files):
newfiles = []
a = ['Godeps', 'third_party', 'exceptions.txt', 'known-flags.txt']
a = ['Godeps', 'vendor', 'third_party', 'exceptions.txt', 'known-flags.txt']
for f in files:
if any(x in f for x in a):
continue
Expand Down
1 change: 1 addition & 0 deletions hack/verify-gofmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ find_files() {
-o -wholename './target' \
-o -wholename '*/third_party/*' \
-o -wholename '*/Godeps/*' \
-o -wholename '*/vendor/*' \
\) -prune \
\) -name '*.go'
}
Expand Down
13 changes: 10 additions & 3 deletions hack/verify-golint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,17 @@ fi
cd "${KUBE_ROOT}"

GOLINT=${GOLINT:-"golint"}
bad_files=$($GOLINT -min_confidence=0.9 ./...)
if [[ -n "${bad_files}" ]]; then
PACKAGES=($(go list ./... | grep -v /vendor/))
bad_files=()
for package in "${PACKAGES[@]}"; do
out=$("${GOLINT}" -min_confidence=0.9 "${package}")
if [[ -n "${out}" ]]; then
bad_files+=("${out}")
fi
done
if [[ "${#bad_files[@]}" -ne 0 ]]; then
echo "!!! '$GOLINT' problems: "
echo "${bad_files}"
echo "${bad_files[@]}"
exit 1
fi

Expand Down

0 comments on commit 7425d4f

Please sign in to comment.