mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-05-07 14:01:49 +02:00
Compare commits
8 commits
2f677756fb
...
0ccb7580be
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0ccb7580be | ||
![]() |
41a6c59634 | ||
![]() |
3e43ab6492 | ||
![]() |
c3920a5a1c | ||
![]() |
c2231b4fef | ||
![]() |
88931d8452 | ||
![]() |
1de201e03f | ||
![]() |
6cd736de69 |
2 changed files with 23 additions and 8 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -38,7 +38,7 @@ jobs:
|
|||
apt-get install -y git make python3 python3-poetry --no-install-recommends
|
||||
poetry install --only lint,test
|
||||
- name: Run linters to enforce code style
|
||||
run: poetry run make lint
|
||||
run: poetry run make check
|
||||
- name: Check that the QA script is up to date with the docs
|
||||
run: "./dev_scripts/qa.py --check-refs"
|
||||
|
||||
|
|
29
Makefile
29
Makefile
|
@ -1,6 +1,19 @@
|
|||
LARGE_TEST_REPO_DIR:=tests/test_docs_large
|
||||
GIT_DESC=$$(git describe)
|
||||
JUNIT_FLAGS := --capture=sys -o junit_logging=all
|
||||
|
||||
lint-ruff: ## check the python source code with various linter rules through ruff
|
||||
ruff check
|
||||
|
||||
lint-ruff-apply: ## apply all fixes made by ruff to the source code
|
||||
ruff check --fix
|
||||
|
||||
format-ruff: ## Check the formatting of the python source code with ruff
|
||||
ruff format --check
|
||||
|
||||
format-ruff-apply: ## apply all the formatting suggestions from ruff
|
||||
ruff format
|
||||
|
||||
MYPY_ARGS := --ignore-missing-imports \
|
||||
--disallow-incomplete-defs \
|
||||
--disallow-untyped-defs \
|
||||
|
@ -9,17 +22,19 @@ MYPY_ARGS := --ignore-missing-imports \
|
|||
--warn-unused-ignores \
|
||||
--exclude $(LARGE_TEST_REPO_DIR)/*.py
|
||||
|
||||
.PHONY: lint
|
||||
lint: ## Check the code for linting, formatting, and typing issues with ruff and mypy
|
||||
ruff check
|
||||
ruff format --check
|
||||
mypy-host:
|
||||
mypy $(MYPY_ARGS) dangerzone
|
||||
|
||||
mypy-tests:
|
||||
mypy $(MYPY_ARGS) tests
|
||||
|
||||
mypy: mypy-host mypy-tests ## check type hints with mypy
|
||||
|
||||
.PHONY: check
|
||||
check: lint-ruff format-ruff mypy ## check the code with ruff and mypy
|
||||
|
||||
.PHONY: fix
|
||||
fix: ## apply all the suggestions from ruff
|
||||
ruff check --fix
|
||||
ruff format
|
||||
fix: lint-ruff-apply format-ruff-apply ## apply all the suggestions from ruff
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
|
|
Loading…
Reference in a new issue