-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
34 lines (29 loc) · 872 Bytes
/
justfile
File metadata and controls
34 lines (29 loc) · 872 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
@_default:
just --list --unsorted
# Run all necessary build commands.
run-all: check-spelling check-commits build-website
# Install the pre-commit hooks
install-precommit:
# Install pre-commit hooks
uvx pre-commit install
# Run pre-commit hooks on all files
uvx pre-commit run --all-files
# Update versions of pre-commit hooks
uvx pre-commit autoupdate
# Check spelling
check-spelling:
uvx typos
# Run checks on commits with non-main branches
check-commits:
#!/bin/zsh
branch_name=$(git rev-parse --abbrev-ref HEAD)
number_of_commits=$(git rev-list --count HEAD ^main)
if [[ ${branch_name} != "main" && ${number_of_commits} -gt 0 ]]
then
uvx cz check --rev-range main..HEAD
else
echo "Can't either be on ${branch_name} or have more than ${number_of_commits}."
fi
# Build the website using Quarto
build-website:
quarto render