From eb63f70928af530e55c5ce3740616af870046913 Mon Sep 17 00:00:00 2001 From: Peter Motzko <56410761+pmoscode@users.noreply.github.com> Date: Tue, 20 Sep 2022 21:06:07 +0200 Subject: [PATCH 1/3] feat(pre-commit): Add colon as valid scope sign --- conventional_pre_commit/format.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conventional_pre_commit/format.py b/conventional_pre_commit/format.py index 9034f0a..b10f02e 100644 --- a/conventional_pre_commit/format.py +++ b/conventional_pre_commit/format.py @@ -23,7 +23,7 @@ def r_types(types): def r_scope(): """Regex str for an optional (scope).""" - return r"(\([\w \/-]+\))?" + return r"(\([\w \/-:]+\))?" def r_delim(): From f475621e9aede1522b434776c4cce44dbb1c0039 Mon Sep 17 00:00:00 2001 From: Peter Motzko Date: Tue, 20 Sep 2022 21:20:48 +0200 Subject: [PATCH 2/3] test(pre-commit): Adjust test with new scope sign --- tests/test_format.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_format.py b/tests/test_format.py index 1125f65..55ffdd0 100644 --- a/tests/test_format.py +++ b/tests/test_format.py @@ -53,6 +53,7 @@ def test_r_scope__special_chars(): assert regex.match("(some_thing)") assert regex.match("(some/thing)") assert regex.match("(some thing)") + assert regex.match("(some:thing)") def test_r_delim(): From 429e1a08ce169906a7bae8596e0072085a468ffe Mon Sep 17 00:00:00 2001 From: Peter Motzko Date: Wed, 21 Sep 2022 13:47:34 +0200 Subject: [PATCH 3/3] test(pre-commit): Swap colon and dash --- conventional_pre_commit/format.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conventional_pre_commit/format.py b/conventional_pre_commit/format.py index b10f02e..b1a6a81 100644 --- a/conventional_pre_commit/format.py +++ b/conventional_pre_commit/format.py @@ -23,7 +23,7 @@ def r_types(types): def r_scope(): """Regex str for an optional (scope).""" - return r"(\([\w \/-:]+\))?" + return r"(\([\w \/:-]+\))?" def r_delim():