From 0e08de776ee8f0467151fe86a5006d39c09ab8f6 Mon Sep 17 00:00:00 2001 From: tris203 Date: Sun, 17 Dec 2023 20:26:23 +0000 Subject: [PATCH] chore: prepush hook --- .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