CI: Configure and enable pre-commit
Change-Id: I7acbeb2b024a7ca81df36fcea8c6c1f052b7f24f
Issue-ID: CIMAN-33
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000..ca94141
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,32 @@
+---
+repos:
+ - repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v4.4.0
+ hooks:
+ - id: trailing-whitespace
+ - id: check-executables-have-shebangs
+ stages: [manual]
+ - id: check-json
+ exclude: (.vscode|.devcontainer)
+ - id: no-commit-to-branch
+ args:
+ - --branch=dev
+ - --branch=master
+ - --branch=main
+ - --branch=rc
+
+ - repo: https://github.com/jorisroovers/gitlint
+ rev: v0.19.1
+ hooks:
+ - id: gitlint
+
+ - repo: https://github.com/adrienverge/yamllint.git
+ rev: v1.31.0
+ hooks:
+ - id: yamllint
+
+ - repo: https://github.com/pre-commit/mirrors-prettier
+ rev: v3.0.0-alpha.9-for-vscode
+ hooks:
+ - id: prettier
+ stages: [commit]