Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,33 @@
just --list --unsorted

# Run all necessary build commands.
run-all: check-spelling build-website
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