From 346cde88c30f49afadbd0464fa727188dd862fcb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 03:20:55 +0200 Subject: [PATCH 1/5] ci: pre-commit autoupdate (#215) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e1d96d8..3faaa2b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,7 @@ repos: - id: requirements-txt-fixer - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.9.3 + rev: v0.9.4 hooks: # Run the linter. - id: ruff @@ -29,11 +29,11 @@ repos: additional_dependencies: [types-PyYAML] exclude: ^testing/resources/ - repo: https://github.com/codespell-project/codespell - rev: v2.4.0 + rev: v2.4.1 hooks: - id: codespell - repo: https://github.com/commit-check/commit-check - rev: v0.9.2 + rev: v0.9.3 hooks: - id: check-message # - id: check-branch # uncomment if you need. From 8e6590d0ba11d8e057f177445380b9ca6ac27c36 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 01:13:35 +0200 Subject: [PATCH 2/5] ci: pre-commit autoupdate (#216) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3faaa2b..2953fc4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,13 +17,13 @@ repos: - id: requirements-txt-fixer - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.9.4 + rev: v0.9.6 hooks: # Run the linter. - id: ruff args: [ --fix ] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.14.1 + rev: v1.15.0 hooks: - id: mypy additional_dependencies: [types-PyYAML] From 224970d124fac4997565de732ef0d8e21e208dcc Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Sun, 16 Feb 2025 21:00:19 +0800 Subject: [PATCH 3/5] feat: add .readthedocs.yaml (#218) * feat: add .readthedocs.yaml * ci: auto fixes from pre-commit.com hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .readthedocs.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .readthedocs.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..9bfb5c2 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,17 @@ +# Read the Docs configuration file for Sphinx projects +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.12" + +sphinx: + builder: "dirhtml" + configuration: docs/conf.py + +# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +python: + install: + - requirements: docs/requirements.txt From 41e0244a12031740d786af555b780e39c248d5b0 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Sun, 16 Feb 2025 21:18:16 +0800 Subject: [PATCH 4/5] fix: update docs requirements.txt (#219) * fix: Update requirements.txt * ci: auto fixes from pre-commit.com hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- docs/requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/requirements.txt b/docs/requirements.txt index d078f24..af718d9 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1 +1,3 @@ + +. sphinx-immaterial From a237cda9cd94d40cb8caee59b7aa878e4589b5c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Koh=C3=A1nyi=20R=C3=B3bert?= Date: Sun, 23 Feb 2025 18:00:11 +0100 Subject: [PATCH 5/5] fix: allow accented letters in author name (#221) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: allow accented letters in author name Allow accented letters (e.g. áéó, etc.) in an author's name. * fix: remove duplicate unicode regex range * fix: add broader regex range to .yml as well * fix: remove duplicate regex key --- .commit-check.yml | 2 +- commit_check/__init__.py | 2 +- tests/author_test.py | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) 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 = []