From 22d86d8863a22f15cf871dc970fe5e894548d267 Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Tue, 14 Nov 2023 17:44:20 +0100 Subject: [PATCH] Add a pre-commit setup to the repository. This will allow us to run some checks before committing. Signed-off-by: Vincent Demeester --- .pre-commit-config.yaml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..337857209c --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,38 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +default_install_hook_types: ["pre-push"] +exclude: '(^vendor|.*golden$)' +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.2.0 + hooks: + - id: check-added-large-files + - id: check-toml + - id: check-shebang-scripts-are-executable + - id: check-json + - id: check-vcs-permalinks + - id: detect-private-key + exclude: ".*_test.go" +- repo: local + hooks: + - id: lint-go + name: "Lint GO" + entry: make + args: ["lint-go"] + language: system + types: [go] + pass_filenames: false + - id: test + name: "Unit testing" + entry: make + args: ["test"] + language: system + types: [go] + pass_filenames: false + - id: lint-yaml + name: "Lint YAML" + entry: make + args: ["lint-yaml"] + language: system + types: [yaml] + pass_filenames: false