chore: add checkgenerate test to lint (#404)
This commit is contained in:
@ -274,6 +274,10 @@ jobs:
|
|||||||
name: staticcheck
|
name: staticcheck
|
||||||
command: make staticcheck
|
command: make staticcheck
|
||||||
when: always
|
when: always
|
||||||
|
- run:
|
||||||
|
name: Check generate
|
||||||
|
command: make checkgenerate
|
||||||
|
when: always
|
||||||
|
|
||||||
check-openapi:
|
check-openapi:
|
||||||
executor: linux-amd64
|
executor: linux-amd64
|
||||||
|
|||||||
3
Makefile
3
Makefile
@ -64,6 +64,9 @@ checktidy:
|
|||||||
checkopenapi:
|
checkopenapi:
|
||||||
./etc/checkopenapi.sh
|
./etc/checkopenapi.sh
|
||||||
|
|
||||||
|
checkgenerate:
|
||||||
|
./etc/checkgenerate.sh
|
||||||
|
|
||||||
staticcheck: $(SOURCES)
|
staticcheck: $(SOURCES)
|
||||||
go run honnef.co/go/tools/cmd/staticcheck -go $(GOVERSION) ./...
|
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'!"
|
||||||
Reference in New Issue
Block a user