diff --git a/.commit-check.yml b/.commit-check.yml index 10f8d39..ad339d0 100644 --- a/.commit-check.yml +++ b/.commit-check.yml @@ -14,7 +14,7 @@ checks: suggest: run command `git checkout -b type/branch_name` - check: author_name - regex: ^[A-Za-z ,.\'-]+$|.*(\[bot]) + regex: ^[A-Za-zÀ-ÖØ-öø-ÿ\u0100-\u017F\u0180-\u024F ,.\'-]+$|.*(\[bot]) error: The committer name seems invalid suggest: run command `git config user.name "Your Name"` diff --git a/commit_check/__init__.py b/commit_check/__init__.py index 61de524..521f68f 100644 --- a/commit_check/__init__.py +++ b/commit_check/__init__.py @@ -32,7 +32,7 @@ }, { 'check': 'author_name', - 'regex': r'^[A-Za-z ,.\'-]+$|.*(\[bot])', + 'regex': r'^[A-Za-zÀ-ÖØ-öø-ÿ\u0100-\u017F\u0180-\u024F ,.\'-]+$|.*(\[bot])', 'error': 'The committer name seems invalid', 'suggest': 'run command `git config user.name "Your Name"`', }, diff --git a/tests/author_test.py b/tests/author_test.py index 21f637d..8936223 100644 --- a/tests/author_test.py +++ b/tests/author_test.py @@ -9,6 +9,7 @@ class TestAuthor: class TestAuthorName: # used by get_commit_info mock fake_author_value_an = "fake_author_name" + fake_accented_author_value_an = "fáké_áúthór_námé" def test_check_author(self, mocker): # Must call get_commit_info, re.match. @@ -29,6 +30,25 @@ def test_check_author(self, mocker): assert m_get_commit_info.call_count == 1 assert m_re_match.call_count == 1 + def test_check_author_with_accented_letters(self, mocker): + # Must call get_commit_info, re.match. + checks = [{ + "check": "author_name", + "regex": "dummy_regex" + }] + m_get_commit_info = mocker.patch( + f"{LOCATION}.get_commit_info", + return_value=self.fake_accented_author_value_an + ) + m_re_match = mocker.patch( + "re.match", + return_value="fake_rematch_resp" + ) + retval = check_author(checks, "author_name") + assert retval == PASS + assert m_get_commit_info.call_count == 1 + assert m_re_match.call_count == 1 + def test_check_author_with_empty_checks(self, mocker): # Must NOT call get_commit_info, re.match. with `checks` param with length 0. checks = [] pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy