-
Notifications
You must be signed in to change notification settings - Fork 200
/
helpers.sh
executable file
·45 lines (38 loc) · 741 Bytes
/
helpers.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
#!/usr/bin/env bash
set -euo pipefail
clean() {
# Remove build artifacts and temporary files
rm -rf {build,dist,__pycache__,*.egg-info,**/*.egg-info,*.pyc,**/*.pyc,reports} 2>/dev/null || true
}
qa() {
# Run static analysis tools
if command -v flake8 >/dev/null 2>&1; then
flake8 .
fi
python run_pylint.py
}
style() {
# Format code
isort .
black --exclude=".*/*(dist|venv|.venv|test-results)/*.*" .
}
case "$1" in
clean)
echo Removing build artifacts and temporary files...
clean
;;
qa)
echo Running static analysis tools...
qa
;;
style)
echo Running code formatters...
style
;;
*)
echo "Usage: $0 [clean|qa|style]"
exit 1
;;
esac
printf 'Done!\n\n'
exit 0