From 988c74ec5665250c572dcc6bae018ed0ea180c25 Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Fri, 13 Aug 2021 12:11:18 +0200 Subject: feat: Add pre-commit hook for linting and formatting (#1132) * feat: Add pre-commit hook for linting and formatting * format with prettier --- .pre-commit-config.yaml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .pre-commit-config.yaml (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..3e3e7d34 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,30 @@ +repos: + - repo: local + hooks: + - id: shfmt + name: shfmt + minimum_pre_commit_version: 2.4.0 + language: golang + additional_dependencies: [mvdan.cc/sh/v3/cmd/shfmt@v3.2.2] + entry: shfmt + args: [-i=2, -ci, -w] + types: [shell] + - id: shellcheck + name: shellcheck + language: system + types: [shell] + entry: bash + args: + [-c, "shfmt -f $(git rev-parse --show-toplevel) | xargs shellcheck"] + - id: stylua + name: StyLua + language: rust + entry: stylua + types: [lua] + args: [.] + - id: luacheck + name: luacheck + language: system + entry: luacheck + types: [lua] + args: [.] -- cgit v1.2.3