Skip to content

Commit

Permalink
fix: fix makefile common case sensitivity
Browse files Browse the repository at this point in the history
  • Loading branch information
adrielp committed Jul 14, 2023
1 parent 61d3355 commit 35ea268
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Makefile.Common
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# In order to ensure make instructions fail if there is command that fails a pipe (ie: `go test ... | tee -a ./test_results.txt`)
# the value `-o pipefail` (or `set -o pipefail`) is added to each shell command that make runs
# otherwise in the example command pipe, only the exit code of `tee` is recorded instead of `go test` which can cause
# test to pass in CI when they should not.
SHELL = /bin/bash
ifeq ($(shell uname -s),Windows)
.SHELLFLAGS = /o pipefile /c
else
.SHELLFLAGS = -o pipefail -c
endif

# SRC_ROOT is the top of the source tree.
SRC_ROOT := $(shell git rev-parse --show-toplevel)

.PHONY: lint
lint:
@go fmt ./...
@go vet ./...
@staticcheck ./...
@gosec ./...
@goimports -w ./

.PHONY: tidy
tidy:
@rm go.sum
@go mod tidy -compat=1.19

0 comments on commit 35ea268

Please sign in to comment.