From 645d7d9a4ab25e26fa8d1b95f1b6ed099feec25b Mon Sep 17 00:00:00 2001 From: rohan2794 Date: Fri, 5 Jul 2024 17:51:30 +0530 Subject: [PATCH] chore: add commit lint and pre commit config file Signed-off-by: rohan2794 --- .pre-commit-config.yaml | 15 +++++++++++++++ commitlint.config.js | 7 +++++++ 2 files changed, 22 insertions(+) create mode 100644 .pre-commit-config.yaml create mode 100644 commitlint.config.js diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..21a70fbd --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,15 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.4.0 # Use the ref you want to point at + hooks: + - id: trailing-whitespace +- repo: local + hooks: + - id: go-checks + name: Go checks + entry: ./scripts/go-checks.sh + types: [file, go] + pass_filenames: true + language: system + description: Run gofmt and lint on files included in the commit. + diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 00000000..ceafd84d --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['@commitlint/config-conventional'], + rules: { + 'type-enum': [2, 'always', ['build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test', 'example']], + }, + defaultIgnores: false, +}