Skip to content

Commit

Permalink
🔧 chore: Update pyproject.toml config
Browse files Browse the repository at this point in the history
- Add bandit for check security in python
- Add django-debug-toolbar for debug
- Add django-migration-linter for check migrations issues
  • Loading branch information
ARYAN-NIKNEZHAD committed Aug 28, 2024
1 parent 3355d78 commit 257880a
Show file tree
Hide file tree
Showing 4 changed files with 205 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,5 @@ uwsgi.ini
nginx.conf
test_app/
myenv/
myenv3_8/
myenv3_8/
bandit_report.txt
12 changes: 11 additions & 1 deletion packages/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
alabaster==0.7.13 ; python_version >= "3.8" and python_version < "4.0"
appdirs==1.4.4 ; python_version >= "3.8" and python_version < "4.0"
argcomplete==3.5.0 ; python_version >= "3.8" and python_version < "4.0"
asgiref==3.8.1 ; python_version >= "3.8" and python_version < "4.0"
astroid==3.2.4 ; python_version >= "3.8" and python_version < "4.0"
babel==2.16.0 ; python_version >= "3.8" and python_version < "4.0"
backports-zoneinfo==0.2.1 ; python_version >= "3.8" and python_version < "3.9"
bandit[toml]==1.7.9 ; python_version >= "3.8" and python_version < "4.0"
black==24.8.0 ; python_version >= "3.8" and python_version < "4.0"
cachetools==5.5.0 ; python_version >= "3.8" and python_version < "4.0"
certifi==2024.7.4 ; python_version >= "3.8" and python_version < "4.0"
Expand All @@ -17,6 +19,8 @@ coverage[toml]==7.6.1 ; python_version >= "3.8" and python_version < "4.0"
decli==0.6.2 ; python_version >= "3.8" and python_version < "4.0"
dill==0.3.8 ; python_version >= "3.8" and python_version < "4.0"
distlib==0.3.8 ; python_version >= "3.8" and python_version < "4.0"
django-debug-toolbar==4.4.6 ; python_version >= "3.8" and python_version < "4.0"
django-migration-linter==5.1.0 ; python_version >= "3.8" and python_version < "4.0"
django-stubs-ext==5.0.4 ; python_version >= "3.8" and python_version < "4.0"
django-stubs==5.0.4 ; python_version >= "3.8" and python_version < "4.0"
django==4.2.15 ; python_version >= "3.8" and python_version < "3.10"
Expand All @@ -32,13 +36,16 @@ importlib-metadata==8.4.0 ; python_version >= "3.8" and python_version < "3.10"
iniconfig==2.0.0 ; python_version >= "3.8" and python_version < "4.0"
isort==5.13.2 ; python_version >= "3.8" and python_version < "4.0"
jinja2==3.1.4 ; python_version >= "3.8" and python_version < "4.0"
markdown-it-py==3.0.0 ; python_version >= "3.8" and python_version < "4.0"
markupsafe==2.1.5 ; python_version >= "3.8" and python_version < "4.0"
mccabe==0.7.0 ; python_version >= "3.8" and python_version < "4.0"
mdurl==0.1.2 ; python_version >= "3.8" and python_version < "4.0"
mypy-extensions==1.0.0 ; python_version >= "3.8" and python_version < "4.0"
mypy==1.11.2 ; python_version >= "3.8" and python_version < "4.0"
nodeenv==1.9.1 ; python_version >= "3.8" and python_version < "4.0"
packaging==24.1 ; python_version >= "3.8" and python_version < "4.0"
pathspec==0.12.1 ; python_version >= "3.8" and python_version < "4.0"
pbr==6.1.0 ; python_version >= "3.8" and python_version < "4.0"
platformdirs==4.2.2 ; python_version >= "3.8" and python_version < "4.0"
pluggy==1.5.0 ; python_version >= "3.8" and python_version < "4.0"
pre-commit==3.5.0 ; python_version >= "3.8" and python_version < "4.0"
Expand All @@ -55,6 +62,7 @@ pytz==2024.1 ; python_version >= "3.8" and python_version < "3.9"
pyyaml==6.0.2 ; python_version >= "3.8" and python_version < "4.0"
questionary==2.0.1 ; python_version >= "3.8" and python_version < "4.0"
requests==2.32.3 ; python_version >= "3.8" and python_version < "4.0"
rich==13.8.0 ; python_version >= "3.8" and python_version < "4.0"
ruff==0.5.7 ; python_version >= "3.8" and python_version < "4.0"
snowballstemmer==2.2.0 ; python_version >= "3.8" and python_version < "4.0"
sphinx-rtd-theme==2.0.0 ; python_version >= "3.8" and python_version < "4.0"
Expand All @@ -67,7 +75,9 @@ sphinxcontrib-jsmath==1.0.1 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-qthelp==1.0.3 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-serializinghtml==1.1.5 ; python_version >= "3.8" and python_version < "4.0"
sqlparse==0.5.1 ; python_version >= "3.8" and python_version < "4.0"
stevedore==5.3.0 ; python_version >= "3.8" and python_version < "4.0"
termcolor==2.4.0 ; python_version >= "3.8" and python_version < "4.0"
toml==0.10.2 ; python_version >= "3.8" and python_version < "4.0"
tomli==2.0.1 ; python_version >= "3.8" and python_full_version <= "3.11.0a6"
tomlkit==0.13.2 ; python_version >= "3.8" and python_version < "4.0"
tox==4.18.0 ; python_version >= "3.8" and python_version < "4.0"
Expand All @@ -78,4 +88,4 @@ untokenize==0.1.1 ; python_version >= "3.8" and python_version < "4.0"
urllib3==2.2.2 ; python_version >= "3.8" and python_version < "4.0"
virtualenv==20.26.3 ; python_version >= "3.8" and python_version < "4.0"
wcwidth==0.2.13 ; python_version >= "3.8" and python_version < "4.0"
zipp==3.20.0 ; python_version >= "3.8" and python_version < "3.10"
zipp==3.20.1 ; python_version >= "3.8" and python_version < "3.10"
174 changes: 169 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 23 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ pylint = "^3.2.6"
pylint-django = "^2.5.5"
docformatter = "^1.7.5"
commitizen = "^3.28.0"

bandit = {extras = ["toml"], version = "^1.7.9"}
django-debug-toolbar = "^4.4.6"
django-migration-linter = "^5.1.0"

[tool.pytest.ini_options]
addopts = "--cov --cov-report=term-missing --cov-report=html"
addopts = "--cov --cov-report=term-missing --cov-report=html --cov-fail-under=90"
DJANGO_SETTINGS_MODULE = "kernel.settings"
python_files = ["tests.py", "test_*.py"]
testpaths = ["tests"]
Expand All @@ -65,6 +67,25 @@ norecursedirs = [
"kernel"
]

[tool.bandit]
targets = ["./iranian_cities"]
exclude_dirs = [
"tests",
"migrations",
]
severity = "medium"
confidence = "medium"
max_lines = 500
progress = true
reports = true
output_format = "screen"
output_file = "bandit_report.txt"
include = ["B101", "B102"]
exclude_tests = ["B301", "B302"]

[tool.bandit.plugins]
B104 = { check_typed_list = true }

[tool.coverage.run]
omit = [
"*/migrations/*",
Expand Down

0 comments on commit 257880a

Please sign in to comment.