Added hook to flush Jupyter notebook outputs

This commit is contained in:
Marvin Scham
2025-10-13 17:37:41 +02:00
parent 0d1dc45ec0
commit 995857ae54
2 changed files with 94 additions and 3 deletions

13
hooks/pre-commit Normal file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
for f in $(git diff --name-only --cached); do
if [[ $f == *.ipynb ]]; then
jupyter nbconvert --clear-output --inplace $f
git add $f
fi
done
if git diff --name-only --cached --exit-code
then
echo "No changes detected after removing notebook output"
exit 1
fi