From bb8a3b74134f42a48acec18ab87e6a0293c07e84 Mon Sep 17 00:00:00 2001 From: Ajesh Sen Thapa <35629644+aj3sh@users.noreply.github.com> Date: Wed, 17 Jul 2024 19:27:14 +0545 Subject: [PATCH] feat: allow bump commits (#55) --- src/commitlint/constants.py | 3 ++- tests/fixtures/linter.py | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/commitlint/constants.py b/src/commitlint/constants.py index c87faf1..499fcd7 100644 --- a/src/commitlint/constants.py +++ b/src/commitlint/constants.py @@ -24,5 +24,6 @@ r"^(Merged (.*?)(in|into) (.*)|Merged PR (.*): (.*))$|" r"^Merge remote-tracking branch(\s*)(.*)$|" r"^Automatic merge(.*)$|" - r"^Auto-merged (.*?) into (.*)$" + r"^Auto-merged (.*?) into (.*)$|" + r"[Bb]ump [^\s]+ from [^\s]+ to [^\s]+" ) diff --git a/tests/fixtures/linter.py b/tests/fixtures/linter.py index d07a816..6d4443d 100644 --- a/tests/fixtures/linter.py +++ b/tests/fixtures/linter.py @@ -51,7 +51,17 @@ True, [], ), + ("feat!: breaking feature", True, []), + # ignored commits (success) ("Merge pull request #123", True, []), + ("Bump urllib3 from 1.26.5 to 1.26.17", True, []), + ("Bump github.com/ollama/ollama from 0.1.48 to 0.2.0", True, []), + ("bump @babel/traverse from 7.22.17 to 7.24.0", True, []), + ( + "Bump github.com/ollama/ollama from 0.1.48 to 0.2.0\n\nthis is a commit body", + True, + [], + ), # incorrect format check ("feat add new feature", False, [INCORRECT_FORMAT_ERROR]), # header length check