diff --git a/hooks/pre-commit b/hooks/pre-commit index 4baa6cf3..7e823659 100644 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -8,11 +8,17 @@ else against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 fi -# Remove trailing commas from `public` directives. These crash on TASM32 -# version 5.0, but work on later versions. +# Remove trailing commas from `public` directives, as well as `public` +# directives without arguments. These crash on TASM32 version 5.0, but work on +# later versions. for f in `git diff-index --name-only --cached --diff-filter=ACMRX ${against} | grep \.asm$ -i`; do if [ -n "$(sed -b -i -E 's/(public\s+[^;]+?),\s*(;.*)?$/\1\2/w /dev/stdout' "$f")" ]; then echo "$f"': removed a trailing comma from a `public` line, please re-stage.' exit 1 fi + if grep -q -E "^public$" "$f"; then + sed -b -i -E '/^public\r?$/d' "$f" + echo "$f"': removed a symbol-less `public`, please re-stage.' + exit 1 + fi done diff --git a/th02_main.asm b/th02_main.asm index d222be34..543e9382 100644 --- a/th02_main.asm +++ b/th02_main.asm @@ -29710,7 +29710,6 @@ _ITEM_PATNUM label byte include th02/main/power_overflow[data].asm _item_skill dw 0 -public public _ITEM_MISS_VELOCITY_Y_CENTER _ITEM_MISS_VELOCITY_Y_SIDES db 0B0h, 0BCh, 0C8h, 0D4h, 0E0h _ITEM_MISS_VELOCITY_X_CENTER db -2, -1, 0, 1, 2