Ignore dev_scripts/envs for tests/lints

Ignore the `dev_scripts/envs` folder when running tests or linting code,
as it may contain files that are not owned by the current user. In this
case, we've seen that pytest/black etc. fail.

This typically happens when the user has run Dangerzone in a
containerized environment (see #286), and Podman created a directory
with files owned by the user in the nested container.
This commit is contained in:
Alex Pyrgiotis 2022-11-29 15:11:37 +02:00
parent e3431c7ac2
commit f16b42bb18
No known key found for this signature in database
GPG key ID: B6C15EBA0357C9AA

View file

@ -1,18 +1,18 @@
.PHONY: lint-black
lint-black: ## check python source code formatting issues, with black
black --check --diff ./
black --check --diff --exclude dev_scripts/envs ./
.PHONY: lint-black-apply
lint-black-apply: ## apply black's source code formatting suggestions
black ./
black --exclude dev_scripts/envs ./
.PHONY: lint-isort
lint-isort: ## check imports are organized, with isort
isort --check-only ./
isort --check-only --skip dev_scripts/envs/** ./
.PHONY: lint-isort-apply
lint-isort-apply: ## apply isort's imports organization suggestions
isort ./
isort --skip dev_scripts/envs/** ./
MYPY_ARGS := --ignore-missing-imports \
--disallow-incomplete-defs \
@ -40,7 +40,7 @@ lint-apply: lint-black-apply lint-isort-apply ## apply all the linter's suggesti
.PHONY: test
test:
./dev_scripts/pytest-wrapper.py -v --cov
./dev_scripts/pytest-wrapper.py -v --cov --ignore dev_scripts
# Makefile self-help borrowed from the securedrop-client project
# Explaination of the below shell command should it ever break.