-
Notifications
You must be signed in to change notification settings - Fork 3
/
Taskfile.yaml
81 lines (69 loc) · 1.76 KB
/
Taskfile.yaml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
version: "3"
vars:
LINT_DIRS: "jupychat/"
tasks:
serve:
interactive: true
silent: true
deps:
- install-deps
cmds:
- |
FILE=".confirmed-allow-chatgpt-to-run-code-on-my-computer"
if [ -f "$FILE" ]; then
exit 0
fi
echo "Are you sure you want to proceed? This will allow ChatGPT to execute code on your computer. (y/N)"
read -r REPLY
if [[ $REPLY =~ ^[Yy]$ ]]
then
# if 'Y' or 'y' was entered, the condition is true
touch $FILE
else
echo "Exiting..."
exit 1
fi
- poetry run uvicorn jupychat.main:app --reload --host "0.0.0.0" --port 8000
install-deps:
run: once
cmds:
- poetry install
sources:
- pyproject.yaml
- poetry.lock
format:black:
desc: Format code using black
cmds:
- task: install-deps
- poetry run black {{.LINT_DIRS}}
lint:black:
desc: Check to see if code matches black formatting
cmds:
- task: install-deps
- poetry run black --diff --check {{.LINT_DIRS}}
lint:ruff:
desc: Check to see if code matches ruff formatting
cmds:
- task: install-deps
- poetry run ruff check {{.LINT_DIRS}}
format:isort:
desc: Sort imports using isort
cmds:
- task: install-deps
- poetry run isort {{.LINT_DIRS}}
lint:isort:
desc: Check to see if imports are sorted using isort
cmds:
- task: install-deps
- poetry run isort --diff --check {{.LINT_DIRS}}
format:
desc: Format code using black and isort
cmds:
- task: format:isort
- task: format:black
lint:
desc: Run all linters
cmds:
- task: lint:ruff
- task: lint:black
- task: lint:isort