Compare commits
1 Commits
v0.7.2
...
dc53d49c3e
| Author | SHA1 | Date | |
|---|---|---|---|
| dc53d49c3e |
@@ -56,6 +56,30 @@ jobs:
|
|||||||
git clone --depth=1 --branch "$REF_NAME" "$REPO_URL" .
|
git clone --depth=1 --branch "$REF_NAME" "$REPO_URL" .
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# This exists because `go vet` does not look at import order: the move to
|
||||||
|
# git.ryuvia.com rewrote every import path without re-sorting, the new path sorts
|
||||||
|
# before github.com/..., and both repos sat unformatted through a green CI run and
|
||||||
|
# a release before anyone noticed.
|
||||||
|
#
|
||||||
|
# Both of gofmt's failure modes need handling, and they are not alike. A file that
|
||||||
|
# is merely misformatted is listed on stdout with exit 0 -- so the failure has to
|
||||||
|
# be raised by hand. A file that does not parse is the opposite: nothing on stdout
|
||||||
|
# and exit 2, which a naive `[ -n "$unformatted" ]` reads as success. The first
|
||||||
|
# draft of this step had exactly that hole.
|
||||||
|
- name: Format
|
||||||
|
run: |
|
||||||
|
if ! unformatted=$(gofmt -l .); then
|
||||||
|
echo "::error::gofmt could not parse the tree"
|
||||||
|
gofmt -l . # re-run unredirected so the parse errors reach the log
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -n "$unformatted" ]; then
|
||||||
|
echo "::error::not gofmt'd:"
|
||||||
|
echo "$unformatted"
|
||||||
|
gofmt -d .
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Vet
|
- name: Vet
|
||||||
run: go vet ./...
|
run: go vet ./...
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,30 @@ jobs:
|
|||||||
REF_NAME: ${{ github.ref_name }}
|
REF_NAME: ${{ github.ref_name }}
|
||||||
run: git clone --depth=1 --branch "$REF_NAME" "$REPO_URL" .
|
run: git clone --depth=1 --branch "$REF_NAME" "$REPO_URL" .
|
||||||
|
|
||||||
|
# This exists because `go vet` does not look at import order: the move to
|
||||||
|
# git.ryuvia.com rewrote every import path without re-sorting, the new path sorts
|
||||||
|
# before github.com/..., and both repos sat unformatted through a green CI run and
|
||||||
|
# a release before anyone noticed.
|
||||||
|
#
|
||||||
|
# Both of gofmt's failure modes need handling, and they are not alike. A file that
|
||||||
|
# is merely misformatted is listed on stdout with exit 0 -- so the failure has to
|
||||||
|
# be raised by hand. A file that does not parse is the opposite: nothing on stdout
|
||||||
|
# and exit 2, which a naive `[ -n "$unformatted" ]` reads as success. The first
|
||||||
|
# draft of this step had exactly that hole.
|
||||||
|
- name: Format
|
||||||
|
run: |
|
||||||
|
if ! unformatted=$(gofmt -l .); then
|
||||||
|
echo "::error::gofmt could not parse the tree"
|
||||||
|
gofmt -l . # re-run unredirected so the parse errors reach the log
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -n "$unformatted" ]; then
|
||||||
|
echo "::error::not gofmt'd:"
|
||||||
|
echo "$unformatted"
|
||||||
|
gofmt -d .
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Vet
|
- name: Vet
|
||||||
run: go vet ./...
|
run: go vet ./...
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user