generated from Significant-Gravitas/Auto-GPT-Plugin-Template
-
Notifications
You must be signed in to change notification settings - Fork 17
/
helpers.sh
executable file
·43 lines (38 loc) · 871 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
#!/usr/bin/env bash
clean() {
# Remove build artifacts and temporary files
rm -rf build 2>/dev/null || true
rm -rf dist 2>/dev/null || true
rm -rf __pycache__ 2>/dev/null || true
rm -rf *.egg-info 2>/dev/null || true
rm -rf **/*.egg-info 2>/dev/null || true
rm -rf *.pyc 2>/dev/null || true
rm -rf **/*.pyc 2>/dev/null || true
rm -rf reports 2>/dev/null || true
}
qa() {
# Run static analysis tools
flake8 .
python run_pylint.py
}
style() {
# Format code
isort .
black --exclude=".*\/*(dist|venv|.venv|test-results)\/*.*" .
}
if [ "$1" = "clean" ]; then
echo Removing build artifacts and temporary files...
clean
elif [ "$1" = "qa" ]; then
echo Running static analysis tools...
qa
elif [ "$1" = "style" ]; then
echo Running code formatters...
style
else
echo "Usage: $0 [clean|qa|style]"
exit 1
fi
echo Done!
echo
exit 0