mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-29 02:12:36 +02:00
Update the makefile
This commit is contained in:
parent
66fe6adf76
commit
e1357ca2fe
1 changed files with 8 additions and 28 deletions
36
Makefile
36
Makefile
|
@ -1,23 +1,6 @@
|
||||||
LARGE_TEST_REPO_DIR:=tests/test_docs_large
|
LARGE_TEST_REPO_DIR:=tests/test_docs_large
|
||||||
GIT_DESC=$$(git describe)
|
GIT_DESC=$$(git describe)
|
||||||
JUNIT_FLAGS := --capture=sys -o junit_logging=all
|
JUNIT_FLAGS := --capture=sys -o junit_logging=all
|
||||||
|
|
||||||
.PHONY: lint-black
|
|
||||||
lint-black: ## check python source code formatting issues, with black
|
|
||||||
black --check --diff ./
|
|
||||||
|
|
||||||
.PHONY: lint-black-apply
|
|
||||||
lint-black-apply: ## apply black's source code formatting suggestions
|
|
||||||
black ./
|
|
||||||
|
|
||||||
.PHONY: lint-isort
|
|
||||||
lint-isort: ## check imports are organized, with isort
|
|
||||||
isort --check --diff ./
|
|
||||||
|
|
||||||
.PHONY: lint-isort-apply
|
|
||||||
lint-isort-apply: ## apply isort's imports organization suggestions
|
|
||||||
isort ./
|
|
||||||
|
|
||||||
MYPY_ARGS := --ignore-missing-imports \
|
MYPY_ARGS := --ignore-missing-imports \
|
||||||
--disallow-incomplete-defs \
|
--disallow-incomplete-defs \
|
||||||
--disallow-untyped-defs \
|
--disallow-untyped-defs \
|
||||||
|
@ -26,21 +9,18 @@ MYPY_ARGS := --ignore-missing-imports \
|
||||||
--warn-unused-ignores \
|
--warn-unused-ignores \
|
||||||
--exclude $(LARGE_TEST_REPO_DIR)/*.py
|
--exclude $(LARGE_TEST_REPO_DIR)/*.py
|
||||||
|
|
||||||
mypy-host:
|
.PHONY: lint
|
||||||
|
lint: ## Check the code for linting, formatting, and typing issues with ruff and mypy
|
||||||
|
ruff check
|
||||||
|
ruff format --check
|
||||||
mypy $(MYPY_ARGS) dangerzone
|
mypy $(MYPY_ARGS) dangerzone
|
||||||
|
|
||||||
mypy-tests:
|
|
||||||
mypy $(MYPY_ARGS) tests
|
mypy $(MYPY_ARGS) tests
|
||||||
|
|
||||||
mypy: mypy-host mypy-tests ## check type hints with mypy
|
.PHONY: fix
|
||||||
|
fix: ## apply all the suggestions from ruff
|
||||||
|
ruff check --fix
|
||||||
|
ruff format .PHONY: test
|
||||||
|
|
||||||
.PHONY: lint
|
|
||||||
lint: lint-black lint-isort mypy ## check the code with various linters
|
|
||||||
|
|
||||||
.PHONY: lint-apply
|
|
||||||
format: lint-black-apply lint-isort-apply ## apply all the linter's suggestions
|
|
||||||
|
|
||||||
.PHONY: test
|
|
||||||
test:
|
test:
|
||||||
# Make each GUI test run as a separate process, to avoid segfaults due to
|
# Make each GUI test run as a separate process, to avoid segfaults due to
|
||||||
# shared state.
|
# shared state.
|
||||||
|
|
Loading…
Reference in a new issue