-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
50 lines (34 loc) · 1.19 KB
/
Makefile
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
.PHONY: black clean doctest lint pylint requirements sedparse test \
test-cmdline test-readme test-reference unit-tests
# Main targets
lint: black pylint
test: doctest unit-tests test-cmdline test-readme test-reference
clean:
rm -f clitest
pip uninstall --yes sedparse
# Secondary targets
black: requirements
black --check --diff --quiet ./*.py tests/*.py
pylint: requirements
pylint ./*.py tests/*.py
doctest:
python -m doctest README.md
unit-tests:
python -m unittest discover -s tests/
test-cmdline: clitest
bash ./clitest --progress none --prefix 4 tests/test_cmdline.md
test-readme: clitest sedparse
bash ./clitest --progress none README.md
test-reference:
python sedparse.py -f tests/reference.sed > tests/reference.json
python sedparse.py --verbose --full -f tests/reference.sed > tests/reference.full.json 2> tests/reference.verbose
git diff --exit-code tests/reference.*
# Dependencies
clitest:
curl --location --remote-name --silent \
https://raw.githubusercontent.com/aureliojargas/clitest/main/clitest
sedparse:
command -v sedparse || pip install --editable .
requirements:
{ command -v black && command -v pylint; } || \
pip install --requirement requirements-dev.txt