From 5bd3e1a8ddb35321d0ceef900a2bbb7a082ea744 Mon Sep 17 00:00:00 2001 From: Tristan Knight Date: Sun, 17 Dec 2023 20:30:44 +0000 Subject: [PATCH] chore: prepush hook (#11) Co-authored-by: tris203 --- .githooks/pre-push.sh | 17 +++++++++++++++++ .github/workflows/lint.yml | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100755 .githooks/pre-push.sh 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