2019-05-19 21:00:40 -04:00
|
|
|
.DEFAULT_GOAL = test
|
|
|
|
.PHONY: FORCE
|
2019-06-04 21:55:20 -04:00
|
|
|
|
2019-09-16 11:34:35 -04:00
|
|
|
# enable module support across all go commands.
|
2019-09-21 01:35:45 -04:00
|
|
|
export GO111MODULE = on
|
2019-09-23 15:17:07 -04:00
|
|
|
# enable consistent Go 1.12/1.13 GOPROXY behavior.
|
|
|
|
export GOPROXY = https://proxy.golang.org
|
2019-09-21 01:35:45 -04:00
|
|
|
|
2019-05-19 21:00:40 -04:00
|
|
|
# Build
|
|
|
|
|
|
|
|
build: golangci-lint
|
2019-12-29 21:32:33 -05:00
|
|
|
.PHONY: build
|
|
|
|
|
|
|
|
build_race:
|
|
|
|
go build -race -o golangci-lint ./cmd/golangci-lint
|
|
|
|
.PHONY: build_race
|
|
|
|
|
2019-05-19 21:00:40 -04:00
|
|
|
clean:
|
2019-09-24 14:44:57 -04:00
|
|
|
rm -f golangci-lint
|
|
|
|
rm -f test/path
|
|
|
|
rm -f tools/Dracula.itermcolors
|
2019-09-25 10:26:46 -04:00
|
|
|
rm -f tools/godownloader
|
|
|
|
rm -f tools/goreleaser
|
|
|
|
rm -f tools/svg-term
|
2019-09-24 14:44:57 -04:00
|
|
|
rm -rf tools/node_modules
|
2019-12-29 21:32:33 -05:00
|
|
|
.PHONY: clean
|
2019-05-19 21:00:40 -04:00
|
|
|
|
|
|
|
# Test
|
2019-09-09 21:54:56 +03:00
|
|
|
test: export GOLANGCI_LINT_INSTALLED = true
|
2019-03-23 20:51:38 +08:00
|
|
|
test: build
|
2019-09-09 21:54:56 +03:00
|
|
|
GL_TEST_RUN=1 time ./golangci-lint run -v
|
2019-09-17 08:42:16 +03:00
|
|
|
GL_TEST_RUN=1 time ./golangci-lint run --fast --no-config -v --skip-dirs 'test/testdata_etc,internal/(cache|renameio|robustio)'
|
|
|
|
GL_TEST_RUN=1 time ./golangci-lint run --no-config -v --skip-dirs 'test/testdata_etc,internal/(cache|renameio|robustio)'
|
2019-09-09 21:54:56 +03:00
|
|
|
GL_TEST_RUN=1 time go test -v ./...
|
2019-05-19 21:00:40 -04:00
|
|
|
.PHONY: test
|
2019-03-23 20:51:38 +08:00
|
|
|
|
2019-12-29 21:32:33 -05:00
|
|
|
test_race: build_race
|
2019-10-08 09:37:54 +03:00
|
|
|
GL_TEST_RUN=1 ./golangci-lint run -v --timeout=5m
|
2019-05-19 21:00:40 -04:00
|
|
|
.PHONY: test_race
|
2018-11-10 15:51:59 +03:00
|
|
|
|
2018-06-28 21:27:07 +03:00
|
|
|
test_linters:
|
|
|
|
GL_TEST_RUN=1 go test -v ./test -count 1 -run TestSourcesFromTestdataWithIssuesDir/$T
|
2019-05-19 21:00:40 -04:00
|
|
|
.PHONY: test_linters
|
2018-06-28 21:27:07 +03:00
|
|
|
|
2019-05-19 21:00:40 -04:00
|
|
|
# Maintenance
|
2018-06-02 14:04:54 +03:00
|
|
|
|
2020-04-22 01:52:59 +03:00
|
|
|
generate: README.md docs/demo.svg install.sh
|
2019-12-29 21:32:33 -05:00
|
|
|
.PHONY: generate
|
|
|
|
|
2020-04-22 01:52:59 +03:00
|
|
|
fast_generate: README.md
|
2019-12-29 21:32:33 -05:00
|
|
|
.PHONY: fast_generate
|
2019-09-09 21:54:56 +03:00
|
|
|
|
2019-05-19 21:00:40 -04:00
|
|
|
maintainer-clean: clean
|
2020-04-22 01:52:59 +03:00
|
|
|
rm -rf docs/demo.svg README.md install.sh
|
2019-12-29 21:32:33 -05:00
|
|
|
.PHONY: maintainer-clean
|
2018-09-01 14:16:30 +03:00
|
|
|
|
2018-06-02 14:04:54 +03:00
|
|
|
check_generated:
|
2019-05-19 21:00:40 -04:00
|
|
|
$(MAKE) --always-make generate
|
2020-04-22 01:52:59 +03:00
|
|
|
git checkout -- go.mod go.sum # can differ between go1.12 and go1.13
|
2019-06-05 00:40:04 -04:00
|
|
|
git diff --exit-code # check no changes
|
2019-05-19 21:00:40 -04:00
|
|
|
.PHONY: check_generated
|
2018-06-02 14:04:54 +03:00
|
|
|
|
2019-09-09 21:54:56 +03:00
|
|
|
fast_check_generated:
|
|
|
|
$(MAKE) --always-make fast_generate
|
2020-04-22 01:52:59 +03:00
|
|
|
git checkout -- go.mod go.sum # can differ between go1.12 and go1.13
|
2019-09-09 21:54:56 +03:00
|
|
|
git diff --exit-code # check no changes
|
|
|
|
.PHONY: fast_check_generated
|
|
|
|
|
2019-09-25 10:26:46 -04:00
|
|
|
release: .goreleaser.yml tools/goreleaser
|
|
|
|
./tools/goreleaser
|
2019-05-19 21:00:40 -04:00
|
|
|
.PHONY: release
|
|
|
|
|
|
|
|
# Non-PHONY targets (real files)
|
|
|
|
|
2019-09-24 11:20:05 -04:00
|
|
|
golangci-lint: FORCE
|
2019-05-19 21:00:40 -04:00
|
|
|
go build -o $@ ./cmd/golangci-lint
|
|
|
|
|
2019-09-25 10:26:46 -04:00
|
|
|
tools/godownloader: export GOFLAGS = -mod=readonly
|
|
|
|
tools/godownloader: tools/go.mod tools/go.sum
|
|
|
|
cd tools && go build github.com/goreleaser/godownloader
|
|
|
|
|
|
|
|
tools/goreleaser: export GOFLAGS = -mod=readonly
|
|
|
|
tools/goreleaser: tools/go.mod tools/go.sum
|
|
|
|
cd tools && go build github.com/goreleaser/goreleaser
|
|
|
|
|
2019-09-24 14:44:57 -04:00
|
|
|
tools/svg-term: tools/package.json tools/package-lock.json
|
2019-09-09 15:37:06 +01:00
|
|
|
cd tools && npm ci
|
2019-05-19 21:00:40 -04:00
|
|
|
ln -sf node_modules/.bin/svg-term $@
|
|
|
|
|
2019-09-24 14:44:57 -04:00
|
|
|
tools/Dracula.itermcolors:
|
2019-05-19 21:00:40 -04:00
|
|
|
curl -fL -o $@ https://raw.githubusercontent.com/dracula/iterm/master/Dracula.itermcolors
|
|
|
|
|
|
|
|
docs/demo.svg: tools/svg-term tools/Dracula.itermcolors
|
2019-09-16 11:34:35 -04:00
|
|
|
./tools/svg-term --cast=183662 --out docs/demo.svg --window --width 110 --height 30 --from 2000 --to 20000 --profile ./tools/Dracula.itermcolors --term iterm2
|
2019-05-19 21:00:40 -04:00
|
|
|
|
2019-09-25 10:26:46 -04:00
|
|
|
install.sh: .goreleaser.yml tools/godownloader
|
|
|
|
./tools/godownloader .goreleaser.yml | sed '/DO NOT EDIT/s/ on [0-9TZ:-]*//' > $@
|
2019-05-19 21:00:40 -04:00
|
|
|
|
|
|
|
README.md: FORCE golangci-lint
|
|
|
|
go run ./scripts/gen_readme/main.go
|
|
|
|
|
|
|
|
go.mod: FORCE
|
2019-09-21 01:35:45 -04:00
|
|
|
go mod tidy
|
|
|
|
go mod verify
|
2019-05-19 21:00:40 -04:00
|
|
|
go.sum: go.mod
|