[workspace] F00: empty crates, licences, Nix flake, hook, CI

This commit is contained in:
2026-11-02 00:51:46 +01:00
parent 43f6f9b70c
commit e91356e1bc
20 changed files with 1167 additions and 3 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/bin/sh
# Enable once per clone: git config core.hooksPath .githooks
# Rejects staged files over 5 MB and anything under build output (target/, result).
max=$((5 * 1024 * 1024))
status=0
git diff --cached --name-only --diff-filter=ACMR | while IFS= read -r path; do
case "/$path" in
*/target/*|/result|/result/*|/result-*)
echo "pre-commit: rejected $path: build output is never committed" >&2; exit 1 ;;
esac
size=$(git cat-file -s ":$path")
if [ "$size" -gt "$max" ]; then
echo "pre-commit: rejected $path: $size bytes is over the 5 MB limit" >&2; exit 1
fi
done || status=1
exit $status