Fixed gocyclo warnings and added pre-commit hook

This commit is contained in:
Oleg Atamanenko
2018-06-09 23:18:40 -04:00
parent 2b05d39067
commit 5c8d82aed0
4 changed files with 103 additions and 88 deletions

View File

@@ -31,6 +31,11 @@ function testGoFmt {
diff <(echo -n) <(go_dirs | xargs -0 gofmt -s -d -l)
}
function testGoCyclo {
diff <(echo -n) <(go_dirs | xargs -0 gocyclo -over 15)
}
function testGoImports {
diff -u <(echo -n) <(go_dirs | xargs -0 goimports -l)
}
@@ -50,6 +55,7 @@ function testExamples {
runTest testGoFmt
runTest testGoImports
runTest testGoVet
runTest testGoCyclo
runTest testGoTest
runTest testExamples