From 4e13198159a0b63f16058c22c59067bdc869dbe2 Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Fri, 15 Nov 2024 19:03:40 +0300 Subject: [PATCH] [#164] pre-commit: Add pre-commit Signed-off-by: Alexander Chuprov --- .pre-commit-config.yaml | 55 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 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 0000000..2deaadc --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,55 @@ +ci: + autofix_prs: false + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-added-large-files + - id: check-case-conflict + - id: check-executables-have-shebangs + - id: check-shebang-scripts-are-executable + - id: check-merge-conflict + - id: check-json + - id: check-xml + - id: check-yaml + - id: trailing-whitespace + args: [--markdown-linebreak-ext=md] + - id: end-of-file-fixer + exclude: "(.key|.svg)$" + + - repo: https://github.com/shellcheck-py/shellcheck-py + rev: v0.9.0.6 + hooks: + - id: shellcheck + + - repo: local + hooks: + - id: make-lint + name: Run Make Lint + entry: make lint + language: system + pass_filenames: false + + - repo: local + hooks: + - id: make-format + name: Run Make format + entry: make format + language: system + pass_filenames: false + + - repo: local + hooks: + - id: go-unit-tests + name: go unit tests + entry: make test GOFLAGS='' + pass_filenames: false + types: [go] + language: system + + - repo: https://github.com/TekWizely/pre-commit-golang + rev: v1.0.0-rc.1 + hooks: + - id: go-staticcheck-repo-mod + - id: go-mod-tidy