diff --git a/.githooks.ini b/.githooks.ini new file mode 100644 index 0000000000..f1e9f479fd --- /dev/null +++ b/.githooks.ini @@ -0,0 +1,7 @@ +# To refresh this file: +# python3 -m python_githooks + +# Make sure dumped assets have not been unignored +# https://github.com/pmret/papermario/wiki/Asset-overrides +[pre-commit] # **** DO NOT REMOVE THIS!! **** +command = (git check-ignore assets/us -q && git check-ignore assets/jp -q && git check-ignore assets/ique -q && git check-ignore assets/pal -q) || (>&2 echo 'ERROR: You appear to be committing dumped assets!\nSee the following document for how to modify assets legally:\nhttps://github.com/pmret/papermario/wiki/Asset-overrides' && exit 1) diff --git a/.gitignore b/.gitignore index 4e45fd5930..c4cb503b00 100644 --- a/.gitignore +++ b/.gitignore @@ -24,9 +24,10 @@ build.ninja *.ld *.elf *.z64 +*.v64 +*.n64 *.Yay0 *.msg.h -*.bin *.i *.o *.zip @@ -41,7 +42,12 @@ build/ /tools/permuter_settings.toml # Assets -/assets/* +# ** DO NOT UNIGNORE THESE FILES!! SEE THE FOLLOWING LINK IF YOU'RE MODDING ASSETS:** +# https://github.com/pmret/papermario/wiki/Asset-overrides +/assets/us +/assets/jp +/assets/pal +/assets/ique # Star Rod /sprite/SpriteTable.xml diff --git a/install.sh b/install.sh index 5eeaeb6502..d33d5843ff 100755 --- a/install.sh +++ b/install.sh @@ -33,6 +33,7 @@ if [[ "$uname" == "Darwin" ]]; then # Install packages brew install md5sha1sum ninja gcc nanaian/brew/mips-linux-gnu-binutils || exit 1 python3 -m pip install -U -r requirements.txt || exit 1 + python3 -m python_githooks || exit 1 if [[ $1 == "--extra" ]]; then echo "Installing extra" @@ -49,6 +50,7 @@ if cat /etc/os-release | grep -E 'ID=debian|ID_LIKE=(.*)debian' &> /dev/null; th ${SUDO} apt install -y curl git python3 python3-pip python3-setuptools build-essential binutils-mips-linux-gnu zlib1g-dev libyaml-dev ninja-build cpp-mips-linux-gnu || exit 1 python3 -m pip install -U -r requirements.txt + python3 -m python_githooks || exit 1 if [[ $1 == "--extra" ]]; then echo "Installing extra" @@ -69,6 +71,7 @@ if cat /etc/os-release | grep -E 'ID=arch|ID_LIKE=arch' &> /dev/null; then # Install dependencies ${SUDO} pacman -S --noconfirm --needed curl git python python-pip python-setuptools base-devel zlib libyaml ninja || exit 1 python3 -m pip install -U -r requirements.txt + python3 -m python_githooks || exit 1 # Install binutils if required if ! command -v mips-linux-gnu-ar &> /dev/null; then @@ -123,6 +126,7 @@ if cat /etc/os-release | grep ID=opensuse &> /dev/null; then ${SUDO} ln -s /usr/bin/mips-suse-linux-strip /usr/bin/mips-linux-gnu-strip python3 -m pip install -U -r requirements.txt + python3 -m python_githooks || exit 1 if [[ $1 == "--extra" ]]; then echo "Installing extra" @@ -145,6 +149,7 @@ if cat /etc/os-release | grep ID=alpine &> /dev/null; then # Install dependencies ${SUDO} apk add --no-cache bash curl wget git python3 python3-dev py3-pip build-base zlib-dev yaml-dev ninja python3 -m pip install -U -r requirements.txt + python3 -m python_githooks || exit 1 # Install binutils if required if ! command -v mips-linux-gnu-ar &> /dev/null; then diff --git a/requirements.txt b/requirements.txt index 792a60dc3f..9ca34d04ef 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,3 +11,4 @@ pygfxd intervaltree rabbitizer n64img +python-githooks