github.com/nalekseevs/itns-golangci-lint@v1.0.2/Makefile (about) 1 .DEFAULT_GOAL = test 2 .PHONY: FORCE 3 4 # enable consistent Go 1.12/1.13 GOPROXY behavior. 5 export GOPROXY = https://proxy.golang.org 6 7 BINARY = golangci-lint 8 ifeq ($(OS),Windows_NT) 9 BINARY := $(BINARY).exe 10 endif 11 12 # Build 13 14 build: $(BINARY) 15 .PHONY: build 16 17 build_race: 18 go build -race -o $(BINARY) ./cmd/golangci-lint 19 .PHONY: build_race 20 21 clean: 22 rm -f $(BINARY) 23 rm -f test/path 24 rm -f tools/Dracula.itermcolors 25 rm -f tools/svg-term 26 rm -rf tools/node_modules 27 .PHONY: clean 28 29 # Test 30 test: export GOLANGCI_LINT_INSTALLED = true 31 test: build 32 GL_TEST_RUN=1 ./$(BINARY) run -v 33 GL_TEST_RUN=1 go test -v -parallel 2 ./... 34 .PHONY: test 35 36 test_race: build_race 37 GL_TEST_RUN=1 ./$(BINARY) run -v --timeout=5m 38 .PHONY: test_race 39 40 # ex: T=output.go make test_integration 41 # the value of `T` is the name of a file from `test/testdata` 42 test_integration: 43 GL_TEST_RUN=1 go test -v ./test -count 1 -run TestSourcesFromTestdata/$T 44 .PHONY: test_integration 45 46 # ex: T=multiple-issues-fix.go make test_integration_fix 47 # the value of `T` is the name of a file from `test/testdata/fix` 48 test_integration_fix: build 49 GL_TEST_RUN=1 go test -v ./test -count 1 -run TestFix/$T 50 .PHONY: test_integration_fix 51 52 # Maintenance 53 54 fast_generate: assets/github-action-config.json 55 .PHONY: fast_generate 56 57 fast_check_generated: 58 $(MAKE) --always-make fast_generate 59 git checkout -- go.mod go.sum # can differ between go1.16 and go1.17 60 git diff --exit-code # check no changes 61 62 # Non-PHONY targets (real files) 63 64 $(BINARY): FORCE 65 go build -o $@ ./cmd/golangci-lint 66 67 # TODO: migrate to docs/ 68 tools/svg-term: tools/package.json tools/package-lock.json 69 cd tools && npm ci 70 ln -sf node_modules/.bin/svg-term $@ 71 72 # TODO: migrate to docs/ 73 tools/Dracula.itermcolors: 74 curl -fL -o $@ https://raw.githubusercontent.com/dracula/iterm/master/Dracula.itermcolors 75 76 # TODO: migrate to docs/ 77 assets/demo.svg: tools/svg-term tools/Dracula.itermcolors 78 ./tools/svg-term --cast=183662 --out assets/demo.svg --window --width 110 --height 30 --from 2000 --to 20000 --profile ./tools/Dracula.itermcolors --term iterm2 79 80 assets/github-action-config.json: FORCE $(BINARY) 81 # go run ./scripts/gen_github_action_config/main.go $@ 82 cd ./scripts/gen_github_action_config/; go run ./main.go ../../$@ 83 84 go.mod: FORCE 85 go mod tidy 86 go mod verify 87 go.sum: go.mod 88 89 website_copy_jsonschema: 90 go run ./scripts/website/copy_jsonschema/ 91 .PHONY: website_copy_jsonschema 92 93 website_expand_templates: 94 go run ./scripts/website/expand_templates/ 95 .PHONY: website_expand_templates 96 97 website_dump_info: 98 go run ./scripts/website/dump_info/ 99 .PHONY: website_dump_info 100 101 update_contributors_list: 102 cd .github/contributors && npm run all 103