makefile stuff
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
53e76cc752
commit
aa748b62b2
4 changed files with 99 additions and 5 deletions
13
.tool/check-license
Executable file
13
.tool/check-license
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
ret=0
|
||||
|
||||
for file in $(find . -type f -iname '*.go' ! -path './vendor/*'); do
|
||||
(head -n3 "${file}" | grep -Eq "(Copyright|generated|GENERATED)") || (echo "${file}:missing license header" && ret=1)
|
||||
done
|
||||
|
||||
exit $ret
|
25
.tool/lint
Executable file
25
.tool/lint
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
if [ ! $(command -v gometalinter) ]; then
|
||||
go get -u github.com/alecthomas/gometalinter
|
||||
gometalinter --update --install
|
||||
fi
|
||||
|
||||
for d in $(find . -type d -not -iwholename '*.git*' -a -not -iname '.tool' -a -not -iwholename '*vendor*'); do
|
||||
gometalinter \
|
||||
--exclude='error return value not checked.*(Close|Log|Print).*\(errcheck\)$' \
|
||||
--exclude='.*_test\.go:.*error return value not checked.*\(errcheck\)$' \
|
||||
--exclude='duplicate of.*_test.go.*\(dupl\)$' \
|
||||
--exclude='schema/fs.go' \
|
||||
--exclude='duplicate of.*main.go.*\(dupl\)$' \
|
||||
--disable=aligncheck \
|
||||
--disable=gotype \
|
||||
--disable=gas \
|
||||
--cyclo-over=35 \
|
||||
--tests \
|
||||
--deadline=10s "${d}"
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue