From f1bb1e97512ba0129d656d3e25555281916c4959 Mon Sep 17 00:00:00 2001 From: Patrick Decat Date: Fri, 29 Mar 2024 16:49:41 +0100 Subject: [PATCH 1/2] build: add pre-commit hook for semantic commit message check --- .pre-commit-config.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1e10e593..22ccccff 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,13 +1,18 @@ +default_install_hook_types: [commit-msg, pre-commit] repos: - repo: https://github.com/antonbabenko/pre-commit-terraform rev: v1.88.4 hooks: - id: terraform_fmt + stages: [pre-commit] - id: terraform_wrapper_module_for_each + stages: [pre-commit] - id: terraform_docs + stages: [pre-commit] args: - "--args=--lockfile=false" - id: terraform_tflint + stages: [pre-commit] args: - "--args=--only=terraform_deprecated_interpolation" - "--args=--only=terraform_deprecated_index" @@ -23,9 +28,19 @@ repos: - "--args=--only=terraform_standard_module_structure" - "--args=--only=terraform_workspace_remote" - id: terraform_validate + stages: [pre-commit] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 hooks: - id: check-merge-conflict + stages: [pre-commit] - id: end-of-file-fixer + stages: [pre-commit] - id: trailing-whitespace + stages: [pre-commit] + - repo: https://github.com/compilerla/conventional-pre-commit + rev: v3.1.0 + hooks: + - id: conventional-pre-commit + stages: [commit-msg] + args: [] # optional: list of Conventional Commits types to allow e.g. [feat, fix, ci, chore, test] From 09504836d2431416060876595dfb1354e464becb Mon Sep 17 00:00:00 2001 From: Patrick Decat Date: Tue, 2 Apr 2024 13:38:48 +0200 Subject: [PATCH 2/2] fix(dev): align semantic commit message check with PR title check --- .pre-commit-config.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 22ccccff..b8ca7cfe 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,4 +43,9 @@ repos: hooks: - id: conventional-pre-commit stages: [commit-msg] - args: [] # optional: list of Conventional Commits types to allow e.g. [feat, fix, ci, chore, test] + args: + - fix + - feat + - docs + - ci + - chore