forked from canonical/snapcraft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (50 loc) · 1.96 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
SOURCES=setup.py snapcraft tests/*.py tests/unit
SOURCES_LEGACY=snapcraft_legacy tests/legacy
.PHONY: autoformat-black
autoformat-black:
black $(SOURCES) $(SOURCES_LEGACY)
.PHONY: freeze-requirements
freeze-requirements:
tools/freeze-requirements.sh
.PHONY: test-black
test-black:
black --check --diff $(SOURCES) $(SOURCES_LEGACY)
.PHONY: test-codespell
test-codespell:
codespell --quiet-level 4 --ignore-words-list crate,keyserver,comandos --skip '*.tar,*.xz,*.zip,*.bz2,*.7z,*.gz,*.deb,*.rpm,*.snap,*.gpg,*.pyc,*.png,*.ico,*.jar,*.so,changelog,.git,.hg,.mypy_cache,.tox,.venv,_build,buck-out,__pycache__,build,dist,.vscode,parts,stage,prime,test_appstream.py,./snapcraft.spec,./.direnv,./.pytest_cache'
.PHONY: test-flake8
test-flake8:
python3 -m flake8 $(SOURCES) $(SOURCES_LEGACY)
.PHONY: test-isort
test-isort:
isort --check $(SOURCES) $(SOURCES_LEGACY)
.PHONY: test-mypy
test-mypy:
mypy $(SOURCES)
.PHONY: test-pydocstyle
test-pydocstyle:
pydocstyle snapcraft
.PHONY: test-pylint
test-pylint:
pylint snapcraft
pylint tests/*.py tests/unit --disable=invalid-name,missing-module-docstring,missing-function-docstring,duplicate-code,protected-access,unspecified-encoding,too-many-public-methods,too-many-arguments,too-many-lines
.PHONY: test-pyright
test-pyright:
pyright $(SOURCES)
.PHONY: test-shellcheck
test-shellcheck:
# Skip third-party gradlew script.
find . \( -name .git -o -name gradlew \) -prune -o -print0 | xargs -0 file -N | grep shell.script | cut -f1 -d: | xargs shellcheck
./tools/spread-shellcheck.py spread.yaml tests/spread/
.PHONY: test-legacy-units
test-legacy-units:
pytest --cov-report=xml --cov=snapcraft tests/legacy/unit
.PHONY: test-units
test-units: test-legacy-units
pytest --cov-report=xml --cov=snapcraft tests/unit
.PHONY: tests
tests: tests-static test-units
.PHONY: tests-static
tests-static: test-black test-codespell test-flake8 test-isort test-mypy test-pydocstyle test-pyright test-pylint test-shellcheck
.PHONY: lint
lint: tests-static