Skip to content

Commit f4af2a8

Browse files
nifadyevsoltanoff
authored andcommitted
Add checker for unused and undeclared dependencies
1 parent 4a2d93d commit f4af2a8

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

{{cookiecutter.project_name}}/.pre-commit-config.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,8 @@ repos:
3030
entry: ruff check app
3131
language: python
3232
types: [python]
33+
- id: unused_undeclared_deps
34+
name: unused_undeclared_deps
35+
entry: deptry backend
36+
language: python
37+
types: [python]

{{cookiecutter.project_name}}/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ lint:
8484
make check
8585
@# For some reason, mypy and pylint fails to resolve PYTHONPATH, set manually.
8686
PYTHONPATH=./app $(MANAGER) run pylint app
87+
$(MANAGER) run deptry backend
8788
PYTHONPATH=./app $(MANAGER) run mypy --namespace-packages --show-error-codes app --check-untyped-defs --ignore-missing-imports --show-traceback
8889

8990

{{cookiecutter.project_name}}/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ pylint-django = "^2.5.4"
4444
pytest-randomly = "^3.15.0"
4545
faker = "^28.4.1"
4646
factory-boy = "^3.3.1"
47+
deptry = "0.21.1"
4748

4849
{%- if cookiecutter.linter == 'Flake8' %}
4950

0 commit comments

Comments
 (0)