forked from asozialesnetzwerk/an-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck.sh
executable file
·39 lines (30 loc) · 1.04 KB
/
check.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
if [ -d venv ];
then
. venv/bin/activate
python3 -m pip install --disable-pip-version-check -r requirements-dev.txt --quiet
else
python3 -m pip install --disable-pip-version-check -r requirements-dev.txt --quiet --user
fi
# install pre-commit hooks
pre-commit install
# test hashing files (important to see if umlaute are used)
git ls-files | xargs sha1sum | sha1sum | cut -d ' ' -f 1
# sort imports
echo isort:
python3 -m isort an_website tests
# check formatting
echo Black:
python3 -m black --check --diff --color an_website tests || echo 'Run "python3 -m black an_website tests" to reformat.'
# check types
echo mypy:
python3 -m mypy --pretty --warn-unused-ignores --warn-redundant-casts -p an_website -p tests
# lint
echo Flake8:
python3 -m flake8 --extend-ignore=D100,D101,D102,D103,D104,E501 an_website tests
echo Pylint:
python3 -m pylint --output-format=colorized an_website tests
# run tests
echo Tests:
python3 -m coverage run --source=an_website -m py.test tests/
echo 'Run "python3 -m coverage report" to show the coverage'