Add quality assurance tests.

This commit is contained in:
giomba 2023-04-08 22:25:17 +02:00
parent ac82d57b09
commit 72dab0b374
3 changed files with 39 additions and 0 deletions

3
pyproject.toml Normal file
View File

@ -0,0 +1,3 @@
[tool.black]
line-length = 79

View File

@ -1,6 +1,20 @@
black==23.3.0
click==8.1.3
flake8==6.0.0
Flask==2.2.3
Flask-HTTPAuth==4.7.0
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.2
mccabe==0.7.0
mypy==1.2.0
mypy-extensions==1.0.0
packaging==23.0
pathspec==0.11.1
platformdirs==3.2.0
pur==7.1.0
pycodestyle==2.10.0
pyflakes==3.0.1
tomli==2.0.1
typing_extensions==4.5.0
Werkzeug==2.2.3

22
script/qa Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
# Software Quality Assurance tests (formatters, linters, ...)
if [ "$1" == "--dry-run" ]; then
BLACK_FLAGS="--check"
fi
set -euo pipefail
cd "$(dirname "$0")/.."
FILES=(
main.py
)
# Code formatting
python3 -m black ${BLACK_FLAGS:-} "${FILES[@]}"
# Linters
python3 -m flake8 "${FILES[@]}"
python3 -m mypy "${FILES[@]}"