github.com/AbsaOSS/env-binder@v1.0.1/Makefile (about)

     1  # Copyright 2021 The k8gb Contributors.
     2  #
     3  # Licensed under the Apache License, Version 2.0 (the "License");
     4  # you may not use this file except in compliance with the License.
     5  # You may obtain a copy of the License at
     6  #
     7  #     http://www.apache.org/licenses/LICENSE-2.0
     8  #
     9  # Unless required by applicable law or agreed to in writing, software
    10  # distributed under the License is distributed on an "AS IS" BASIS,
    11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  # See the License for the specific language governing permissions and
    13  # limitations under the License.
    14  #
    15  # Generated by GoLic, for more details see: https://github.com/AbsaOSS/golic
    16  SHELL := bash
    17  
    18  ifndef NO_COLOR
    19  YELLOW=\033[0;33m
    20  CYAN=\033[1;36m
    21  RED=\033[31m
    22  # no color
    23  NC=\033[0m
    24  endif
    25  
    26  GOLIC_VERSION  ?= v0.5.0
    27  GOLINT_VERSION  ?= v1.45.0
    28  
    29  # check integrity
    30  .PHONY: check
    31  check: lint license test ## Check project integrity
    32  
    33  # run glonag-ci
    34  .PHONY: lint
    35  lint:
    36  	@echo -e "\n$(YELLOW)Running the linters$(NC)"
    37  	@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLINT_VERSION)
    38  	$(GOBIN)/golangci-lint run
    39  
    40  # updates source code with license headers
    41  .PHONY: license
    42  license:
    43  	@echo -e "\n$(YELLOW)Injecting the license$(NC)"
    44  	@go install github.com/AbsaOSS/golic@$(GOLIC_VERSION)
    45  	$(GOBIN)/golic inject -t apache2
    46  
    47  # run tests
    48  .PHONY: test
    49  test:
    50  	go test ./... -race -coverprofile cover.out
    51  
    52  define golic
    53  	@echo -e "\n$(YELLOW)Injecting the license$(NC)"
    54  	@go install github.com/AbsaOSS/golic@$(GOLIC_VERSION)
    55  	$(GOBIN)/golic inject $1
    56  endef
    57  
    58  all: check