github.com/m4gshm/gollections@v0.0.13-0.20240331203319-a34a86e58a24/Makefile (about)

     1  
     2  .PHONY: all
     3  all: clean build test readme lint bench
     4  
     5  .PHONY: test
     6  test:
     7  	$(info #Running tests...)
     8  	go test ./...
     9  
    10  .PHONY: cover
    11  cover:
    12  	$(info #Running cover tests...)
    13  	go test -coverprofile=coverage.out -coverpkg=github.com/m4gshm/gollections/...  ./...
    14  	go tool cover -html=coverage.out
    15  
    16  .PHONY: cover-console-out
    17  cover-console-out:
    18  	$(info #Running cover tests...)
    19  	go test -coverprofile=coverage.out -coverpkg=github.com/m4gshm/gollections/...  ./...
    20  	go tool cover -func=coverage.out
    21  
    22  .PHONY: clean
    23  clean:
    24  	$(info #Building...)
    25  	go clean -cache
    26  	go clean -testcache
    27  
    28  .PHONY: build
    29  build:
    30  	$(info #Building...)
    31  	# go env -w GOEXPERIMENT=rangefunc,newinliner	
    32  	go env -w GOEXPERIMENT=rangefunc
    33  	go build ./...
    34  
    35  .PHONY: builda
    36  builda:
    37  	$(info #Building...)
    38  	go clean -cache
    39  	go build -gcflags -m ./...
    40  
    41  .PHONY: bench
    42  bench:
    43  	$(info #Running benchmarks...)
    44  	# go test -gcflags=-d=loopvar=3 -benchtime 1s -bench . -benchmem ./...
    45  	# go env -w GOEXPERIMENT=rangefunc,newinliner
    46  	go env -w GOEXPERIMENT=rangefunc
    47  	go test -benchtime 1s -bench . -benchmem ./...
    48  
    49  .PHONY: update
    50  update:
    51  	$(info #Undate tools...)
    52  	go install github.com/go-delve/delve/cmd/dlv@latest
    53  	go install golang.org/x/tools/gopls@latest
    54  
    55  .PHONY: lint
    56  lint:
    57  	$(info #Lints...)
    58  	go install golang.org/x/tools/cmd/goimports@latest
    59  	goimports -w .
    60  	# go vet ./...
    61  	# go install github.com/tetafro/godot/cmd/godot@latest
    62  	# godot .
    63  	go install github.com/kisielk/errcheck@latest
    64  	errcheck -ignoretests ./...
    65  	# go install github.com/alexkohler/nakedret/cmd/nakedret@latest
    66  	# nakedret ./...
    67  	# go install golang.org/x/lint/golint@latest
    68  	# golint ./...
    69  	go install github.com/mgechev/revive@latest
    70  	revive -exclude internal/... ./...
    71  	go install github.com/alexkohler/prealloc@latest
    72  	prealloc ./...
    73  
    74  .PHONY: readme
    75  readme:
    76  	$(info #README.md...)
    77  	asciidoctor -b docbook internal/docs/readme.adoc 
    78  	pandoc -f docbook -t gfm internal/docs/readme.xml -o README.md