github.com/elek/golangci-lint@v1.42.2-0.20211208090441-c05b7fcb3a9a/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  # Build
     8  
     9  build: golangci-lint
    10  .PHONY: build
    11  
    12  build_race:
    13  	go build -race -o golangci-lint ./cmd/golangci-lint
    14  .PHONY: build_race
    15  
    16  clean:
    17  	rm -f golangci-lint
    18  	rm -f test/path
    19  	rm -f tools/Dracula.itermcolors
    20  	rm -f tools/goreleaser
    21  	rm -f tools/svg-term
    22  	rm -rf tools/node_modules
    23  .PHONY: clean
    24  
    25  # Test
    26  test: export GOLANGCI_LINT_INSTALLED = true
    27  test: build
    28  	GL_TEST_RUN=1 ./golangci-lint run -v
    29  	GL_TEST_RUN=1 go test -v -parallel 2 ./...
    30  .PHONY: test
    31  
    32  test_race: build_race
    33  	GL_TEST_RUN=1 ./golangci-lint run -v --timeout=5m
    34  .PHONY: test_race
    35  
    36  test_linters:
    37  	GL_TEST_RUN=1 go test -v ./test -count 1 -run TestSourcesFromTestdataWithIssuesDir/$T
    38  .PHONY: test_linters
    39  
    40  # Maintenance
    41  
    42  fast_generate: assets/github-action-config.json
    43  .PHONY: fast_generate
    44  
    45  fast_check_generated:
    46  	$(MAKE) --always-make fast_generate
    47  	git checkout -- go.mod go.sum # can differ between go1.16 and go1.17
    48  	git diff --exit-code # check no changes
    49  
    50  release: .goreleaser.yml tools/goreleaser
    51  	./tools/goreleaser
    52  .PHONY: release
    53  
    54  snapshot: .goreleaser.yml tools/goreleaser
    55  	./tools/goreleaser --snapshot --rm-dist
    56  .PHONY: snapshot
    57  
    58  # Non-PHONY targets (real files)
    59  
    60  golangci-lint: FORCE
    61  	go build -o $@ ./cmd/golangci-lint
    62  
    63  tools/goreleaser: export GOFLAGS = -mod=readonly
    64  tools/goreleaser: tools/go.mod tools/go.sum
    65  	cd tools && go build github.com/goreleaser/goreleaser
    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 golangci-lint
    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  expand_website_templates:
    90  	go run ./scripts/expand_website_templates/main.go
    91  .PHONY: expand_website_templates
    92  
    93  update_contributors_list:
    94  	cd .github/contributors && npm run all
    95  
    96  update_netlify_state:
    97  	go run ./scripts/expand_website_templates/main.go -only-state