@@ -27,9 +27,11 @@ gofmt linting:
|
|||||||
allow_failure: true
|
allow_failure: true
|
||||||
<<: *only-default
|
<<: *only-default
|
||||||
before_script:
|
before_script:
|
||||||
- apk -q add go
|
# specific mirror used because staticcheck hasn't made it to the other mirrors yet...
|
||||||
|
- apk -q update --repository http://dl-4.alpinelinux.org/alpine/edge/testing
|
||||||
|
- apk -q add --repository http://dl-4.alpinelinux.org/alpine/edge/testing go staticcheck
|
||||||
script:
|
script:
|
||||||
- .gitlab-ci/check_gofmt.sh
|
- .gitlab-ci/check_linting.sh
|
||||||
|
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
|
@@ -1,11 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
files="$(gofmt -l .)"
|
|
||||||
|
|
||||||
[ -z "$files" ] && exit 0
|
|
||||||
|
|
||||||
# run gofmt to print out the diff of what needs to be changed
|
|
||||||
|
|
||||||
gofmt -d -e .
|
|
||||||
|
|
||||||
exit 1
|
|
13
.gitlab-ci/check_linting.sh
Executable file
13
.gitlab-ci/check_linting.sh
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "### Running gofmt..."
|
||||||
|
files="$(gofmt -l .)"
|
||||||
|
|
||||||
|
if [ ! -z "$files" ]; then
|
||||||
|
# run gofmt to print out the diff of what needs to be changed
|
||||||
|
gofmt -d -e .
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "### Running staticcheck..."
|
||||||
|
staticcheck ./...
|
Reference in New Issue
Block a user