-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
46 lines (38 loc) · 1006 Bytes
/
justfile
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
set fallback
[private]
help:
just --list
# installs pre-commit hooks (and pre-commit if it is not installed)
install-hooks: install-pre-commit
#!/usr/bin/env bash
set -euo pipefail
if [ ! -f .git/hooks/pre-commit ]; then
pre-commit install
fi
[private]
install-pre-commit:
#!/usr/bin/env bash
set -euo pipefail
# Check if command pre-commit is available. If yes - exists
if command -v pre-commit &> /dev/null; then
exit 0
fi
# Check if pipx exists. If it does not, asks
if ! command -v pipx &> /dev/null; then
echo "pipx is not installed. It is recommended to install pre-commit using pipx rather than pip. Please install pipx using `pip install pipx` and try again."
exit 1
fi
pipx install pre-commit
setup: install-hooks
run:
#!/usr/bin/env bash
set -euo pipefail
poetry run python -m run_server
test:
#!/usr/bin/env bash
set -euo pipefail
poetry run pytest
check-all:
#!/usr/bin/env bash
set -euo pipefail
pre-commit run --all-files