File: makefile

package info (click to toggle)
golang-github-zmap-zlint 3.6.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,008 kB
  • sloc: sh: 162; makefile: 38
file content (50 lines) | stat: -rw-r--r-- 1,926 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
SHELL := /bin/bash
# Number of linting Go routines to use in integration tests
PARALLELISM := 5
# Additional integration test flags. Example usage:
#   make integration PARALLELISM=99 INT_FLAGS="-fingerprintSummary -forceDownload"
#   make integration INT_FLAGS="-overwriteExpected -config custom.config.json"
#   make integration INT_FLAGS="-fingerprintSummary -lintSummary -fingerprintFilter='^[ea]' -lintFilter='^w_ext_cert_policy_explicit_text_not_utf8' -config small.config.json"
#   make integration INT_FLAGS="-lintSummary -fingerprintSummary -lintFilter='^e_' -config small.config.json"
#   make integration INT_FLAGS="-lintSummary -fingerprintSummary -excludeSources='Mozilla,ETSI_ESI' -config small.config.json"
#   make integration INT_FLAGS="-includeSources='Mozilla,ETSI_ESI' -config small.config.json"
INT_FLAGS :=

GIT_VERSION := "$(shell git describe --abbrev=8)"

CMDS = zlint zlint-gtld-update
CMD_PREFIX = ./cmd/
BUILD = $(GO_ENV) go build --ldflags="-X 'main.version=$(GIT_VERSION)'"
TEST = $(GO_ENV) GORACE=halt_on_error=1 go test -race
INT_TEST = $(GO_ENV) go test -v -tags integration -timeout 20m ./integration/. -parallelism $(PARALLELISM) $(INT_FLAGS)

all: $(CMDS)

zlint:
	$(BUILD) $(CMD_PREFIX)$(@)

zlint-gtld-update:
	$(BUILD) $(CMD_PREFIX)$(@)

clean:
	rm -f $(CMDS)

test:
	$(TEST) ./...

integration:
	$(INT_TEST)

code-lint:
	# Skip these two directories as they contain Go files that are tests for custom
	# code linting framework and there is no expectation of those files conforming to anything.
	golangci-lint run --skip-dirs lints/lints/testdata/,lints/testdata

custom-code-lint:
	(cd integration/lints/ && go run main.go ../../lints)
	(cd integration/lints/ && go run main.go ../../cmd/genTestCerts)

testdata-lint:
	./test/prepend_testcerts_openssl.sh && git diff --exit-code testdata/

.PHONY: clean zlint zlint-gtld-update test integration code-lint testdata-lint custom-code-lint