-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun
More file actions
executable file
·43 lines (38 loc) · 737 Bytes
/
run
File metadata and controls
executable file
·43 lines (38 loc) · 737 Bytes
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
#!/bin/bash
set -e
ensure_venv() {
if [ ! -d ".venv" ]; then
echo "Virtual environment not found. Run: python3 -m venv .venv"
exit 1
fi
source .venv/bin/activate
}
usage() {
echo "Usage: ./run <command>"
echo "Commands:"
echo " lint fix Run lint with auto-fix"
echo " lint Run lint checks"
echo " test Run tests"
}
if [ $# -lt 1 ]; then
usage
exit 1
fi
case "$1" in
lint)
ensure_venv
if [ "$2" = "fix" ]; then
python -m ruff check --fix .
else
python -m ruff check .
fi
;;
test)
ensure_venv
python -m pytest
;;
*)
usage
exit 1
;;
esac