This repository was archived by the owner on Mar 30, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- .PHONY : all setup lint build test image-build image-push
1+ .PHONY : all setup lint lint-timezone build test image-build image-push
22
33TEST_TIMEOUT := 10s
44SHELL := /bin/bash
@@ -22,13 +22,25 @@ bin/gofumpt: bin
2222build : cmd/main.go
2323 CGO_ENABLED=0 go build -ldflags=" -X github.com/duneanalytics/blockchain-ingester/client/duneapi.commitHash=$( shell git rev-parse --short HEAD) " -o indexer cmd/main.go
2424
25- lint : bin/golangci-lint bin/gofumpt
25+ lint : bin/golangci-lint bin/gofumpt lint-timezone
2626 go fmt ./...
2727 go vet ./...
2828 bin/golangci-lint -c .golangci.yml run ./...
2929 bin/gofumpt -l -e -d ./
3030 go mod tidy
3131
32+ # All binary entrypoints must set time.Local = time.UTC in init() to ensure
33+ # time.Now() always returns UTC.
34+ lint-timezone :
35+ @fail=0; \
36+ for f in $$ (find . -name main.go -path ' */cmd/*/main.go' ); do \
37+ if ! grep -q ' time\.Local = time\.UTC' " $$ f" ; then \
38+ echo " ERROR: $$ f missing 'time.Local = time.UTC' in init()" ; \
39+ fail=1; \
40+ fi ; \
41+ done ; \
42+ if [ " $$ fail" -eq 1 ]; then exit 1; fi
43+
3244test :
3345 go mod tidy
3446 CGO_ENABLED=1 go test -timeout=$(TEST_TIMEOUT ) -race -bench=. -benchmem -cover ./...
You can’t perform that action at this time.
0 commit comments