Skip to content

Commit

Permalink
Ignore dev_scripts/envs for tests/lints
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
apyrgio committed Jan 16, 2023
1 parent c52984b commit 87174d2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 87174d2

Please sign in to comment.