diff --git a/Justfile b/Justfile index 939f6a4..feb8b47 100644 --- a/Justfile +++ b/Justfile @@ -5,6 +5,16 @@ default: @just --list +# Install local development tooling. +install: install-git-hooks + +# Install Git hooks for this repository. +install-git-hooks: + @mkdir -p .git/hooks + @printf '%s\n' '#!/bin/sh' '' 'just check' > .git/hooks/pre-push + @chmod +x .git/hooks/pre-push + @printf '%s\n' 'Installed .git/hooks/pre-push' + # Lint all Lua source with luacheck. check: luacheck . diff --git a/README.md b/README.md index 6abac5d..55269ef 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,19 @@ # Trap's ComputerCraft APIs +## Development + +Requirements: +- `just` +- `luacheck` + +After cloning the repository, run: + +``` +just install +``` + +This installs the local Git hooks, including a pre-push hook that runs `just check`. + ## Installation ``` wget run https://raw.githubusercontent.com/guillaumearm/cc-libs/master/install.lua