-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Michal Witkowski
committed
Feb 28, 2017
1 parent
ef60a37
commit 4889d78
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
# Script that checks up code (govet). | ||
|
||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)" | ||
|
||
function print_real_go_files { | ||
grep --files-without-match 'DO NOT EDIT!' $(find . -iname '*.go') | ||
} | ||
|
||
function govet_all { | ||
ret=0 | ||
for i in $(print_real_go_files); do | ||
output=$(go tool vet -all=true -tests=false ${i}) | ||
ret=$(($ret | $?)) | ||
echo -n ${output} | ||
done; | ||
return ${ret} | ||
} | ||
|
||
govet_all | ||
echo "returning $?" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
# Script that checks the code for errors. | ||
|
||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)" | ||
|
||
function print_real_go_files { | ||
grep --files-without-match 'DO NOT EDIT!' $(find . -iname '*.go') | ||
} | ||
|
||
function generate_markdown { | ||
echo "Generating markdown" | ||
oldpwd=$(pwd) | ||
for i in $(find . -iname 'doc.go'); do | ||
dir=${i%/*} | ||
echo "$dir" | ||
cd ${dir} | ||
${GOPATH}/bin/godocdown -heading=Title -o DOC.md | ||
ln -s DOC.md README.md 2> /dev/null # can fail | ||
cd ${oldpwd} | ||
done; | ||
} | ||
|
||
function goimports_all { | ||
echo "Running goimports" | ||
goimports -l -w $(print_real_go_files) | ||
return $? | ||
} | ||
|
||
generate_markdown | ||
goimports_all | ||
echo "returning $?" |