Skip to content

Commit 53cf96f

Browse files
chore(sync): 🔨 synced file(s) with seedcase-project/seedcase-theme
1 parent dc27eeb commit 53cf96f

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

justfile

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,33 @@
22
just --list --unsorted
33

44
# Run all necessary build commands.
5-
run-all: check-spelling build-website
5+
run-all: check-spelling check-commits build-website
6+
7+
# Install the pre-commit hooks
8+
install-precommit:
9+
# Install pre-commit hooks
10+
uvx pre-commit install
11+
# Run pre-commit hooks on all files
12+
uvx pre-commit run --all-files
13+
# Update versions of pre-commit hooks
14+
uvx pre-commit autoupdate
615

716
# Check spelling
817
check-spelling:
918
uvx typos
1019

20+
# Run checks on commits with non-main branches
21+
check-commits:
22+
#!/bin/zsh
23+
branch_name=$(git rev-parse --abbrev-ref HEAD)
24+
number_of_commits=$(git rev-list --count HEAD ^main)
25+
if [[ ${branch_name} != "main" && ${number_of_commits} -gt 0 ]]
26+
then
27+
uvx cz check --rev-range main..HEAD
28+
else
29+
echo "Can't either be on ${branch_name} or have more than ${number_of_commits}."
30+
fi
31+
1132
# Build the website using Quarto
1233
build-website:
1334
quarto render

0 commit comments

Comments
 (0)