Debian Codegraph @

Makefile

raw symbols SCIP
1 # Copyright 2020 The Compose Specification Authors.
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 IMAGE_PREFIX=composespec/conformance-tests-
16
17 ifeq ($(OS),Windows_NT)
18 BINARY_EXT=.exe
19 endif
20
21 .PHONY: build
22 build: ## Build command line
23 go build -o bin/compose-spec-$(GOOS)-$(GOARCH)$(BINARY_EXT) cmd/main.go
24
25 .PHONY: test
26 test: ## Run tests
27 gotestsum ./...
28
29 .PHONY: fmt
30 fmt: ## Format go files
31 go fmt ./...
32
33 .PHONY: deepcopy
34 deepcopy: build-validate-image
35 docker run --rm -v .:/go/src $(IMAGE_PREFIX)validate goderive ./types/...
36
37 .PHONY: build-validate-image
38 build-validate-image:
39 docker build . -f ci/Dockerfile -t $(IMAGE_PREFIX)validate
40
41 .PHONY: lint
42 lint: build-validate-image
43 docker run --rm -v .:/go/src $(IMAGE_PREFIX)validate golangci-lint run --config ./.golangci.yml ./...
44
45 .PHONY: check-license
46 check-license: build-validate-image
47 docker run --rm -v .:/go/src $(IMAGE_PREFIX)validate ltag -t scripts/validate/template --excludes "validate dotenv" --check -v
48
49 .PHONY: setup
50 setup: ## Setup the precommit hook
51 @which pre-commit > /dev/null 2>&1 || (echo "pre-commit not installed see README." && false)
52 @pre-commit install