-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (50 loc) · 1.57 KB
/
Copy pathMakefile
File metadata and controls
69 lines (50 loc) · 1.57 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
PROJECT = httplint
VERSIONING = calver
GITHUB_STEP_SUMMARY ?= throwaway
TEST_SCRIPTS = $(wildcard test/test_*.py)
TEST_TARGETS = $(patsubst test/%.py,%,$(TEST_SCRIPTS))
.PHONY: test
test: $(TEST_TARGETS) test_smoke coverage i18n-check check_detail_escaping
.PHONY: check_detail_escaping
check_detail_escaping: venv
PYTHONPATH=. $(VENV)/python tools/check_detail_escaping.py
.PHONY: test_fields
test_fields: test/http-fields.xml venv
PYTHONPATH=. $(VENV)/python test/test_fields.py test/http-fields.xml
PYTHONPATH=. $(VENV)/pytest --md $(GITHUB_STEP_SUMMARY) -k "not FieldTest" --config-file pyproject.toml httplint/field
rm -f throwaway
test_field_%: venv
PYTHONPATH=. $(VENV)/pytest -k "not FieldTest" httplint/field/parsers/$*.py
test_%: venv
PYTHONPATH=. $(VENV)/python test/$@.py
.PHONY: test_smoke
test_smoke: venv
PYTHONPATH=. $(VENV)/python test/smoke.py
.PHONY: coverage
coverage: venv
PYTHONPATH=. $(VENV)/python test/coverage.py
test/http-fields.xml:
curl -o $@ https://www.iana.org/assignments/http-fields/http-fields.xml
.PHONY: clean
clean: clean_py
.PHONY: lint
lint: lint_py
.PHONY: typecheck
typecheck: typecheck_py
.PHONY: tidy
tidy: tidy_py
.PHONY: update_readme
update_readme: venv
PYTHONPATH=. $(VENV)/python tools/update_readme.py
.PHONY: run
run: lint typecheck tidy
# Pass arguments to the url target
ifeq (url,$(firstword $(MAKECMDGOALS)))
URL_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
.DEFAULT: ; @:
endif
.PHONY: url
url: venv
curl -si $(URL_ARGS) | $(VENV)/httplint --now
include Makefile.pyproject
include Makefile.i18n