From 2f8544f8e8ff79762dc2b34a93ec265f85d82acf Mon Sep 17 00:00:00 2001 From: Denis Gorbachev <829578+DenisGorbachev@users.noreply.github.com> Date: Mon, 22 Jul 2024 06:28:07 +0700 Subject: [PATCH] chore: configure commitlint --- commitlint.config.mjs | 1 + install.sh | 4 +++- lefthook.yml | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 commitlint.config.mjs diff --git a/commitlint.config.mjs b/commitlint.config.mjs new file mode 100644 index 0000000..7c4ff4d --- /dev/null +++ b/commitlint.config.mjs @@ -0,0 +1 @@ +export default { extends: ['@commitlint/config-conventional'] } diff --git a/install.sh b/install.sh index 706677b..15d534a 100755 --- a/install.sh +++ b/install.sh @@ -4,7 +4,9 @@ npm install --global \ lefthook@1.6.9 \ remark-cli@12.0.1 \ remark-validate-links@8.0.0 \ - remark-lint-no-dead-urls@1.1.0 + remark-lint-no-dead-urls@1.1.0 \ + @commitlint/cli@19.3.0 \ + @commitlint/config-conventional@19.2.2 cargo install --git https://github.com/DenisGorbachev/cargo-doc2readme --branch dev diff --git a/lefthook.yml b/lefthook.yml index d923552..9c506bc 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -19,3 +19,5 @@ pre-commit: run: remark --ignore-path .gitignore --quiet --frail --no-stdout . test-docs: run: cargo test --doc + lint-commit: + run: commitlint --from HEAD~1 --to HEAD