github.com/snowflakedb/gosnowflake@v1.9.0/gosnowflake.mak (about)

     1  ## Setup
     2  SHELL := /bin/bash
     3  SRC = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
     4  
     5  setup:
     6  	@which golint &> /dev/null  || go install golang.org/x/lint/golint@latest
     7  	@which make2help &> /dev/null || go install github.com/Songmu/make2help/cmd/make2help@latest
     8  	@which staticcheck &> /dev/null || go install honnef.co/go/tools/cmd/staticcheck@v0.4
     9  
    10  ## Install dependencies
    11  deps: setup
    12  	go mod tidy	
    13  
    14  ## Show help
    15  help:
    16  	@make2help $(MAKEFILE_LIST)
    17  
    18  # Format source codes (internally used)
    19  cfmt: setup
    20  	@gofmt -l -w $(SRC)
    21  
    22  # Lint (internally used)
    23  clint: deps
    24  	@echo "Running staticcheck" && staticcheck
    25  	@echo "Running go vet and lint"
    26  	@for pkg in $$(go list ./... | grep -v /vendor/); do \
    27  		echo "Verifying $$pkg"; \
    28  		go vet $$pkg; \
    29  		golint -set_exit_status $$pkg || exit $$?; \
    30  	done
    31  
    32  # Install (internally used)
    33  cinstall:
    34  	@export GOBIN=$$GOPATH/bin; \
    35  	go install -tags=sfdebug $(CMD_TARGET).go
    36  
    37  # Run (internally used)
    38  crun: install
    39  	$(CMD_TARGET)
    40  
    41  .PHONY: setup help cfmt clint cinstall crun