chore: add checkgenerate test to lint
(#404)
This commit is contained in:
parent
09881c0214
commit
85c690f1f1
@ -274,6 +274,10 @@ jobs:
|
||||
name: staticcheck
|
||||
command: make staticcheck
|
||||
when: always
|
||||
- run:
|
||||
name: Check generate
|
||||
command: make checkgenerate
|
||||
when: always
|
||||
|
||||
check-openapi:
|
||||
executor: linux-amd64
|
||||
|
3
Makefile
3
Makefile
@ -64,6 +64,9 @@ checktidy:
|
||||
checkopenapi:
|
||||
./etc/checkopenapi.sh
|
||||
|
||||
checkgenerate:
|
||||
./etc/checkgenerate.sh
|
||||
|
||||
staticcheck: $(SOURCES)
|
||||
go run honnef.co/go/tools/cmd/staticcheck -go $(GOVERSION) ./...
|
||||
|
||||
|
16
etc/checkgenerate.sh
Executable file
16
etc/checkgenerate.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
function check_changes () {
|
||||
changes="$(git status --porcelain=v1 2>/dev/null)"
|
||||
if [ -n "$changes" ] ; then
|
||||
echo $1
|
||||
echo "$changes"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_changes "git is dirty before running 'make generate-sources!'"
|
||||
make mock
|
||||
check_changes "git is dirty after running 'make generate-sources'!"
|
Loading…
x
Reference in New Issue
Block a user