github.com/yuqengo/golangci-lint@v0.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  # 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  # ex: T=gofmt.go make test_fix
    33  # the value of `T` is the name of a file from `test/testdata/fix`
    34  test_fix: build
    35  	GL_TEST_RUN=1 go test -v ./test -count 1 -run TestFix/$T
    36  .PHONY: test_fix
    37  
    38  test_race: build_race
    39  	GL_TEST_RUN=1 ./golangci-lint run -v --timeout=5m
    40  .PHONY: test_race
    41  
    42  test_linters:
    43  	GL_TEST_RUN=1 go test -v ./test -count 1 -run TestSourcesFromTestdataWithIssuesDir/$T
    44  .PHONY: test_linters
    45  
    46  # Maintenance
    47  
    48  fast_generate: assets/github-action-config.json
    49  .PHONY: fast_generate
    50  
    51  fast_check_generated:
    52  	$(MAKE) --always-make fast_generate
    53  	git checkout -- go.mod go.sum # can differ between go1.16 and go1.17
    54  	git diff --exit-code # check no changes
    55  
    56  release: .goreleaser.yml tools/goreleaser
    57  	./tools/goreleaser
    58  .PHONY: release
    59  
    60  snapshot: .goreleaser.yml tools/goreleaser
    61  	./tools/goreleaser --snapshot --rm-dist
    62  .PHONY: snapshot
    63  
    64  # Non-PHONY targets (real files)
    65  
    66  golangci-lint: FORCE
    67  	go build -o $@ ./cmd/golangci-lint
    68  
    69  tools/goreleaser: export GOFLAGS = -mod=readonly
    70  tools/goreleaser: tools/go.mod tools/go.sum
    71  	cd tools && go build github.com/goreleaser/goreleaser
    72  
    73  # TODO: migrate to docs/
    74  tools/svg-term: tools/package.json tools/package-lock.json
    75  	cd tools && npm ci
    76  	ln -sf node_modules/.bin/svg-term $@
    77  
    78  # TODO: migrate to docs/
    79  tools/Dracula.itermcolors:
    80  	curl -fL -o $@ https://raw.githubusercontent.com/dracula/iterm/master/Dracula.itermcolors
    81  
    82  # TODO: migrate to docs/
    83  assets/demo.svg: tools/svg-term tools/Dracula.itermcolors
    84  	./tools/svg-term --cast=183662 --out assets/demo.svg --window --width 110 --height 30 --from 2000 --to 20000 --profile ./tools/Dracula.itermcolors --term iterm2
    85  
    86  assets/github-action-config.json: FORCE golangci-lint
    87  	# go run ./scripts/gen_github_action_config/main.go $@
    88  	cd ./scripts/gen_github_action_config/; go run ./main.go ../../$@
    89  
    90  go.mod: FORCE
    91  	go mod tidy
    92  	go mod verify
    93  go.sum: go.mod
    94  
    95  expand_website_templates:
    96  	go run ./scripts/expand_website_templates/main.go
    97  .PHONY: expand_website_templates
    98  
    99  update_contributors_list:
   100  	cd .github/contributors && npm run all
   101  
   102  update_netlify_state:
   103  	go run ./scripts/expand_website_templates/main.go -only-state