github.com/snyk/vervet/v4@v4.27.2/Makefile (about)

     1  
     2  .PHONY: all
     3  all: lint test build
     4  
     5  .PHONY: build
     6  build:
     7  	go build -a -o vervet ./cmd/vervet
     8  
     9  # Run go mod tidy yourself
    10  
    11  #----------------------------------------------------------------------------------
    12  # Check for updates to packages in remote OSS repositories and update go.mod AND
    13  # go.sum to match changes. Then download the all the dependencies
    14  # This catches when your app has colliding versions of packages during updates
    15  #----------------------------------------------------------------------------------
    16  .PHONY: update-deps
    17  update-deps:
    18  	go get -d -u ./...
    19  
    20  # go mod download yourself if you don't need to update
    21  
    22  .PHONY: lint
    23  lint:
    24  	golangci-lint run -v ./...
    25  	(cd versionware/example; golangci-lint run -v ./...)
    26  
    27  .PHONY: lint-docker
    28  lint-docker:
    29  	docker run --rm -v $(shell pwd):/vervet -w /vervet golangci/golangci-lint:v1.42.1 golangci-lint run -v ./...
    30  
    31  #----------------------------------------------------------------------------------
    32  #  Ignores the test cache and forces a full test suite execution
    33  #----------------------------------------------------------------------------------
    34  .PHONY: test
    35  test:
    36  	go test ./... -count=1
    37  	(cd versionware/example; go generate . && go test ./... -count=1)
    38  
    39  .PHONY: test-coverage
    40  test-coverage:
    41  	go test ./... -count=1 -coverprofile=covfile
    42  	go tool cover -html=covfile
    43  	rm -f covfile
    44  
    45  .PHONY: clean
    46  clean:
    47  	$(RM) vervet