Skip to content

Commit

Permalink
Merge pull request #5270 from oasisprotocol/peternose/internal/fix-go…
Browse files Browse the repository at this point in the history
…-mod-tidy

makefile: Exit with an error if go mod tidy fails
  • Loading branch information
peternose authored Dec 5, 2023
2 parents c4ed9bb + 68e1420 commit cea60c8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .changelog/5270.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
makefile: Exit with an error if go mod tidy fails
2 changes: 1 addition & 1 deletion common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ endef
# NOTE: go mod tidy doesn't implement a check mode yet.
# For more details, see: https://github.com/golang/go/issues/27005.
define CHECK_GO_MOD_TIDY =
$(GO) mod tidy; \
$(GO) mod tidy && \
if [[ ! -z `git status --porcelain go.mod go.sum` ]]; then \
$(ECHO) "$(RED)Error: The following changes detected after running 'go mod tidy':$(OFF)"; \
git diff go.mod go.sum; \
Expand Down
2 changes: 1 addition & 1 deletion go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ clean:
generate $(go-binaries) $(go-plugins) build \
$(test-helpers) build-helpers \
$(test-vectors-targets) \
fmt lint \
fmt lint lint-mod-tidy \
$(test-targets) test force-test \
clean all

Expand Down

0 comments on commit cea60c8

Please sign in to comment.