diff --git a/.githooks/pre-push.sh b/.githooks/pre-push.sh new file mode 100755 index 0000000..b1fb65c --- /dev/null +++ b/.githooks/pre-push.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# +# This hook is called by 'git push' and can be used to prevent a push from taking place. +# + +# Stylua check +stylua --check lua/ --config-path ./.stylua.toml || exit 1 +echo "Stylua check passed" + +# Luacheck +luacheck lua/ --globals vim || exit 1 +echo "Luacheck passed" + +# Echo success +echo "Pre-push checks passed" +exit 0 + diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 527e04f..fbabf24 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,7 +17,7 @@ jobs: - name: Setup run: | sudo apt-get update - sudo apt-get install luarocks + sudo apt-get install luarocks -y sudo luarocks install luacheck - name: Lint