forked from NHERI-SimCenter/pelicun
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrun_checks.sh
executable file
·49 lines (43 loc) · 911 Bytes
/
run_checks.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
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
# Spell-check
echo "Spell-checking."
echo
codespell .
if [ $? -ne 0 ]; then
echo "Spell-checking failed."
exit 1
fi
# Check formatting with ruff
echo "Checking formatting with 'ruff format --diff'."
echo
ruff format --diff
if [ $? -ne 0 ]; then
echo "ruff format failed."
exit 1
fi
# Run ruff for linting
echo "Linting with 'ruff check --fix'."
echo
ruff check --fix --output-format concise
if [ $? -ne 0 ]; then
echo "ruff check failed."
exit 1
fi
# Run mypy for type checking
echo "Type checking with mypy."
echo
mypy pelicun
if [ $? -ne 0 ]; then
echo "mypy failed. Exiting."
exit 1
fi
# Run pytest for testing and generate coverage report
echo "Running unit-tests."
echo
python -m pytest pelicun/tests --cov=pelicun --cov-report html -n auto
if [ $? -ne 0 ]; then
echo "pytest failed. Exiting."
exit 1
fi
echo "All checks passed successfully."
echo