Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function run_checks {
}

# add pre-commit commands here
run_checks "bandit" bandit src -c pyproject.toml -r
run_checks "bandit" bandit pyproject.toml -r
run_checks "isort" isort src --check
run_checks "mypy" mypy src
run_checks "ruff check" ruff check src
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/fawltydeps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
on: [push]

jobs:
fawltydeps:
runs-on: ubuntu-latest
name: "fawltydeps"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
pip install -e .[dev]
- name: Run fawltydeps
run: |
fawltydeps
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ https://spokanetech.github.io/blog/building-spokane-tech/intro/
| Workflow | Description | Status |
|----------|-------------------------|------------------------------------------------------------------------------|
|Bandit|security checks|![Bandit](https://github.com/SpokaneTech/SpokaneTechWeb/actions/workflows/bandit.yaml/badge.svg)|
|FawltyDeps|dependency checks|![FawltyDeps](https://github.com/SpokaneTech/SpokaneTechWeb/actions/workflows/fawltydeps.yaml/badge.svg)|
|Isort|python import ordering|![Isort](https://github.com/SpokaneTech/SpokaneTechWeb/actions/workflows/isort.yaml/badge.svg)|
|Mypy|static type checking|![Mypy](https://github.com/SpokaneTech/SpokaneTechWeb/actions/workflows/mypy.yaml/badge.svg)|
|PyTest|unittest execution|![Pytest](https://github.com/SpokaneTech/SpokaneTechWeb/actions/workflows/pytest.yaml/badge.svg)|
|Radon|code complexity analysis|![Radon](https://github.com/SpokaneTech/SpokaneTechWeb/actions/workflows/radon.yaml/badge.svg)|
|Ruff Format|code formatting|![Format](https://github.com/SpokaneTech/SpokaneTechWeb/actions/workflows/ruff_format.yaml/badge.svg)|
|Ruff Lint|static code analysis|![Lint](https://github.com/SpokaneTech/SpokaneTechWeb/actions/workflows/ruff_lint.yaml/badge.svg)|
Expand Down
46 changes: 42 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ dependencies = [
"psycopg2-binary",
"redis",
"requests>=2.26.0",
"pillow",
"playwright",
"whitenoise",
]
Expand All @@ -35,6 +34,7 @@ dev = [
"coveralls",
"django-debug-toolbar",
"faker",
"fawltydeps",
"isort",
"model-bakery",
"mypy",
Expand All @@ -56,7 +56,7 @@ docker = [
[tool.bandit]
exclude_dirs = [
"venv",
"src/django_project/local_test",
"src/local_test",
"src/django_project/tests",
"src/django_project/*/management/commands",
"src/django_project/*/scripts/*"
Expand All @@ -70,6 +70,7 @@ line-length = 120
[tool.coverage.report]
show_missing = true
omit = [
"src/local_test/*",
"src/django_project/manage.py",
"src/django_project/core/asgi.py",
"src/django_project/core/wsgi.py",
Expand All @@ -91,7 +92,7 @@ profile = "black"
[tool.mypy]
exclude = [
"venv/*",
"src/django_project/local_test",
"src/local_test",
"src/django_project/.*/migrations/.*",
"src/django_project/.*/scripts/.*",
]
Expand All @@ -114,8 +115,45 @@ exclude = [
"src/django_project/tests",
"src/django_project/*/migrations",
"src/django_project/*/scripts",
"src/django_project/*/local_test"
"src/local_test"
]


[tool.fawltydeps]
code = ["src/django_project"]
deps = ["pyproject.toml"]
ignore_unused = [
"bandit",
"black",
"coveralls",
"django-braces",
"django-celery-beat",
"django-debug-toolbar",
"django-extensions",
"django-filter",
"gunicorn",
"faker",
"fawltydeps",
"flower",
"isort",
"model-bakery",
"mypy",
"mypy-extensions",
"ruff",
"pillow",
"psycopg2-binary",
"pytest",
"pytest-cov",
"pytest-django",
"radon",
"redis",
"safety",
"types-python-dateutil",
"types-requests",
"typing_extensions",
"whitenoise"
]
output_format = "human_detailed"


[tool.setuptools.packages.find]
Expand Down
1 change: 0 additions & 1 deletion src/django_project/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
# third party apps
"django_celery_beat",
"django_extensions",
"django_filters",
"handyhelpers",
# project apps
"web",
Expand Down