Skip to content

Commit 489c35d

Browse files
committed
pre-commit hook
1 parent 7fce756 commit 489c35d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.hooks/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
branch=$(git rev-parse --symbolic --abbrev-ref HEAD)
3+
if [ "main" == "$branch" ]; then
4+
make build-docs
5+
fi

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ else
77
endif
88

99
# == SETUP REPOSITORY AND DEPENDENCIES
10+
set-hooks:
11+
cp .hooks/pre-commit .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit
1012

1113
dev-sync:
1214
uv sync --cache-dir .uv_cache --all-extras
1315

14-
setup: dev-sync
16+
setup: set-hooks dev-sync
1517

1618
build-docs:
1719
. $(VENV_BIN)/activate && mkdocs build

0 commit comments

Comments
 (0)