From 982e26543dc277efa591f704a2ed450705a227c3 Mon Sep 17 00:00:00 2001 From: "repo-helper[bot]" <74742576+repo-helper[bot]@users.noreply.github.com> Date: Wed, 8 Jul 2026 22:58:24 +0000 Subject: [PATCH 1/2] Updated files with 'repo_helper'. --- .github/workflows/docs_test_action.yml | 4 ++-- .github/workflows/flake8.yml | 6 +++--- .github/workflows/mypy.yml | 6 +++--- .github/workflows/python_ci.yml | 8 ++++---- .github/workflows/python_ci_linux.yml | 14 +++++++------- .github/workflows/python_ci_macos.yml | 6 +++--- .pre-commit-config.yaml | 12 ++++++++++-- justfile | 5 +++++ tox.ini | 2 -- 9 files changed, 37 insertions(+), 26 deletions(-) diff --git a/.github/workflows/docs_test_action.yml b/.github/workflows/docs_test_action.yml index 39ae450..f47c729 100644 --- a/.github/workflows/docs_test_action.yml +++ b/.github/workflows/docs_test_action.yml @@ -16,10 +16,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ - uses: "actions/checkout@v4" + uses: "actions/checkout@v6" - name: Check for changed files - uses: dorny/paths-filter@v2 + uses: dorny/paths-filter@v4 id: changes with: list-files: "json" diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index 1ecb7b9..1f5be86 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -19,10 +19,10 @@ jobs: steps: - name: Checkout 🛎️ - uses: "actions/checkout@v4" + uses: "actions/checkout@v6" - name: Check for changed files - uses: dorny/paths-filter@v2 + uses: dorny/paths-filter@v4 id: changes with: list-files: "json" @@ -32,7 +32,7 @@ jobs: - name: Setup Python 🐍 if: steps.changes.outputs.code == 'true' - uses: "actions/setup-python@v5" + uses: "actions/setup-python@v6" with: python-version: "3.9" diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index b889816..2b5e4f8 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -24,10 +24,10 @@ jobs: steps: - name: Checkout 🛎️ - uses: "actions/checkout@v4" + uses: "actions/checkout@v6" - name: Check for changed files - uses: dorny/paths-filter@v2 + uses: dorny/paths-filter@v4 id: changes with: list-files: "json" @@ -37,7 +37,7 @@ jobs: - name: Setup Python 🐍 if: steps.changes.outputs.code == 'true' - uses: "actions/setup-python@v5" + uses: "actions/setup-python@v6" with: python-version: "3.9" diff --git a/.github/workflows/python_ci.yml b/.github/workflows/python_ci.yml index 5e2f58e..de52382 100644 --- a/.github/workflows/python_ci.yml +++ b/.github/workflows/python_ci.yml @@ -37,15 +37,15 @@ jobs: - {python-version: "pypy-3.7", testenvs: "pypy37,build", experimental: False} - {python-version: "pypy-3.8", testenvs: "pypy38", experimental: False} - {python-version: "pypy-3.9-v7.3.16", testenvs: "pypy39", experimental: True} - - {python-version: "pypy-3.10-v7.3.19", testenvs: "pypy310,build", experimental: True} + - {python-version: "pypy-3.10-v7.3.19", testenvs: "pypy310", experimental: True} steps: - name: Checkout 🛎️ - uses: "actions/checkout@v4" + uses: "actions/checkout@v6" - name: Check for changed files if: startsWith(github.ref, 'refs/tags/') != true - uses: dorny/paths-filter@v2 + uses: dorny/paths-filter@v4 id: changes with: list-files: "json" @@ -56,7 +56,7 @@ jobs: - name: Setup Python 🐍 id: setup-python if: ${{ steps.changes.outputs.code == 'true' || steps.changes.outcome == 'skipped' }} - uses: "actions/setup-python@v5" + uses: "actions/setup-python@v6" with: python-version: "${{ matrix.config.python-version }}" diff --git a/.github/workflows/python_ci_linux.yml b/.github/workflows/python_ci_linux.yml index b0504f9..a0a591d 100644 --- a/.github/workflows/python_ci_linux.yml +++ b/.github/workflows/python_ci_linux.yml @@ -42,11 +42,11 @@ jobs: steps: - name: Checkout 🛎️ - uses: "actions/checkout@v4" + uses: "actions/checkout@v6" - name: Check for changed files if: startsWith(github.ref, 'refs/tags/') != true - uses: dorny/paths-filter@v2 + uses: dorny/paths-filter@v4 id: changes with: list-files: "json" @@ -57,7 +57,7 @@ jobs: - name: Setup Python 🐍 id: setup-python if: ${{ steps.changes.outputs.code == 'true' || steps.changes.outcome == 'skipped' }} - uses: "actions/setup-python@v5" + uses: "actions/setup-python@v6" with: python-version: "${{ matrix.config.python-version }}" @@ -91,10 +91,10 @@ jobs: runs-on: "ubuntu-22.04" steps: - name: Checkout 🛎️ - uses: "actions/checkout@v4" + uses: "actions/checkout@v6" - name: Setup Python 🐍 - uses: "actions/setup-python@v5" + uses: "actions/setup-python@v6" with: python-version: 3.8 @@ -144,11 +144,11 @@ jobs: runs-on: "ubuntu-22.04" steps: - name: Checkout 🛎️ - uses: "actions/checkout@v4" + uses: "actions/checkout@v6" if: startsWith(github.ref, 'refs/tags/') - name: Setup Python 🐍 - uses: "actions/setup-python@v5" + uses: "actions/setup-python@v6" if: startsWith(github.ref, 'refs/tags/') with: python-version: 3.8 diff --git a/.github/workflows/python_ci_macos.yml b/.github/workflows/python_ci_macos.yml index 7cfd5dc..a6b734d 100644 --- a/.github/workflows/python_ci_macos.yml +++ b/.github/workflows/python_ci_macos.yml @@ -41,11 +41,11 @@ jobs: steps: - name: Checkout 🛎️ - uses: "actions/checkout@v4" + uses: "actions/checkout@v6" - name: Check for changed files if: startsWith(github.ref, 'refs/tags/') != true - uses: dorny/paths-filter@v2 + uses: dorny/paths-filter@v4 id: changes with: list-files: "json" @@ -56,7 +56,7 @@ jobs: - name: Setup Python 🐍 id: setup-python if: ${{ steps.changes.outputs.code == 'true' || steps.changes.outcome == 'skipped' }} - uses: "actions/setup-python@v5" + uses: "actions/setup-python@v6" with: python-version: "${{ matrix.config.python-version }}" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 952ff8f..bf00d0b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,6 +5,7 @@ exclude: ^domdf_python_tools/compat/importlib_resources.py$ ci: autoupdate_schedule: quarterly + skip: [taplo-lint] repos: - repo: https://github.com/repo-helper/pyproject-parser @@ -21,7 +22,6 @@ repos: - id: check-case-conflict - id: check-executables-have-shebangs - id: check-json - - id: check-toml - id: check-yaml - id: check-merge-conflict - id: check-symlinks @@ -31,6 +31,12 @@ repos: - id: mixed-line-ending - id: end-of-file-fixer + - repo: https://github.com/domdfcoding/taplo-pre-commit + rev: v0.10.0 + hooks: + - id: taplo-lint + args: [] + - repo: https://github.com/domdfcoding/pre-commit-hooks rev: v0.7.0 hooks: @@ -78,9 +84,11 @@ repos: - id: forbid-crlf - repo: https://github.com/python-formate/snippet-fmt - rev: v0.1.5 + rev: v0.3.1 hooks: - id: snippet-fmt + additional_dependencies: + - formate-trailing-commas>=0.1.1 - repo: https://github.com/python-formate/formate rev: v1.2.1 diff --git a/justfile b/justfile index 9cd8b78..4307956 100644 --- a/justfile +++ b/justfile @@ -23,3 +23,8 @@ bare-ignore: lint: unused-imports incomplete-defs bare-ignore tox -n qa + +uncomm: + git status -uall --ignored + +# Custom commands can be added below this comment diff --git a/tox.ini b/tox.ini index d80004e..9c4408b 100644 --- a/tox.ini +++ b/tox.ini @@ -67,13 +67,11 @@ setenv = PIP_DISABLE_PIP_VERSION_CHECK=1 [testenv:py313] -download = True setenv = PYTHONDEVMODE=1 PIP_DISABLE_PIP_VERSION_CHECK=1 [testenv:py312] -download = True setenv = PYTHONDEVMODE=1 PIP_DISABLE_PIP_VERSION_CHECK=1 From e5bc1c17a625590845faaa46ef33f3b9cbad4484 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 8 Jul 2026 22:59:10 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc-source/api/bases.rst | 2 +- domdf_python_tools/doctools.py | 4 +-- domdf_python_tools/getters.py | 20 +++++++------- domdf_python_tools/iterative.py | 6 ++--- domdf_python_tools/pagesizes/units.py | 38 +++++++++++++-------------- domdf_python_tools/stringlist.py | 6 ++--- domdf_python_tools/words.py | 6 ++--- 7 files changed, 41 insertions(+), 41 deletions(-) diff --git a/doc-source/api/bases.rst b/doc-source/api/bases.rst index 2669e00..6c77ecc 100644 --- a/doc-source/api/bases.rst +++ b/doc-source/api/bases.rst @@ -63,7 +63,7 @@ from :class:`NamedList` rather than from :func:`~.namedlist`. For example, do th .. code-block:: python >>> class ShoppingList(NamedList): - ... pass + ... pass >>> and not this: diff --git a/domdf_python_tools/doctools.py b/domdf_python_tools/doctools.py index 6ae998c..048523f 100644 --- a/domdf_python_tools/doctools.py +++ b/domdf_python_tools/doctools.py @@ -216,8 +216,8 @@ def sphinxify_docstring() -> Callable[[_F], _F]: .. code-block:: python intersphinx_mapping = { - "python": ("https://docs.python.org/3/", None), - } + "python": ("https://docs.python.org/3/", None), + } """ def wrapper(target: _F) -> _F: diff --git a/domdf_python_tools/getters.py b/domdf_python_tools/getters.py index 32f9884..f77ae07 100644 --- a/domdf_python_tools/getters.py +++ b/domdf_python_tools/getters.py @@ -55,9 +55,9 @@ class attrgetter: .. code-block:: python >>> from pathlib import Path - >>> attrgetter(0, 'name')([Path("dir/code.py")]) + >>> attrgetter(0, "name")([Path("dir/code.py")]) 'code.py' - >>> attrgetter(2, 'parent.name')([Path("dir/coincidence.py"), Path("dir/wheel.py"), Path("dir/operator.py")]) + >>> attrgetter(2, "parent.name")([Path("dir/coincidence.py"), Path("dir/wheel.py"), Path("dir/operator.py")]) 'dir' .. seealso:: :func:`operator.attrgetter` and :func:`operator.itemgetter` @@ -110,14 +110,14 @@ class itemgetter: .. code-block:: python - >>> itemgetter(0, 1)(['ABCDEFG']) + >>> itemgetter(0, 1)(["ABCDEFG"]) 'B' - >>> itemgetter(1, 2)(['ABC', 'DEF']) + >>> itemgetter(1, 2)(["ABC", "DEF"]) 'F' - >>> itemgetter(0, slice(2, None))(['ABCDEFG']) + >>> itemgetter(0, slice(2, None))(["ABCDEFG"]) 'CDEFG' - >>> army = [dict(rank='captain', name='Blackadder'), dict(rank='Private', name='Baldrick')] - >>> itemgetter(0, 'rank')(army) + >>> army = [dict(rank="captain", name="Blackadder"), dict(rank="Private", name="Baldrick")] + >>> itemgetter(0, "rank")(army) 'captain' .. seealso:: :func:`operator.itemgetter` @@ -158,11 +158,11 @@ class methodcaller: .. code-block:: python >>> from datetime import date - >>> methodcaller(0, 'upper')(["hello", "world"]) + >>> methodcaller(0, "upper")(["hello", "world"]) 'HELLO' - >>> methodcaller(1, 'center', 9, "=")(["hello", "world"]) + >>> methodcaller(1, "center", 9, '=')(["hello", "world"]) '==world==' - >>> methodcaller(0, 'replace', year=2019)([date(2021, 7, 6)]) + >>> methodcaller(0, "replace", year=2019)([date(2021, 7, 6)]) datetime.date(2019, 7, 6) .. seealso:: :func:`operator.methodcaller` and :func:`operator.itemgetter` diff --git a/domdf_python_tools/iterative.py b/domdf_python_tools/iterative.py index 5d24cf6..76f6b89 100644 --- a/domdf_python_tools/iterative.py +++ b/domdf_python_tools/iterative.py @@ -306,9 +306,9 @@ def groupfloats( .. code-block:: python >>> list(groupfloats( - ... [170.0, 170.05, 170.1, 170.15, 171.05, 171.1, 171.15, 171.2], - ... step=0.05, - ... )) + ... [170.0, 170.05, 170.1, 170.15, 171.05, 171.1, 171.15, 171.2], + ... step=0.05, + ... )) [(170.0, 170.05, 170.1, 170.15), (171.05, 171.1, 171.15, 171.2)] >>> list(groupfloats([1, 2, 3, 4, 5, 7, 8, 9, 10])) [(1, 2, 3, 4, 5), (7, 8, 9, 10)] diff --git a/domdf_python_tools/pagesizes/units.py b/domdf_python_tools/pagesizes/units.py index 2792f78..58aa29f 100644 --- a/domdf_python_tools/pagesizes/units.py +++ b/domdf_python_tools/pagesizes/units.py @@ -80,7 +80,7 @@ class Unit(float): .. code-block:: python - >>> (3*mm) + (7*mm) + >>> (3 * mm) + (7 * mm) When adding different :class:`~domdf_python_tools.pagesizes.units.Unit` objects, @@ -88,18 +88,18 @@ class Unit(float): .. code-block:: python - >>> (2.54*cm) + inch + >>> (2.54 * cm) + inch - >>> inch + (2.54*cm) + >>> inch + (2.54 * cm) :class:`~domdf_python_tools.pagesizes.units.Unit` objects can also be added to :class:`float` and :class:`int` objects: .. code-block:: python - >>> (3*cm) + 7 + >>> (3 * cm) + 7 - >>> 7 + (3*cm) + >>> 7 + (3 * cm) @@ -109,15 +109,15 @@ class Unit(float): .. code-block:: python - >>> (17*mm) - (7*mm) + >>> (17 * mm) - (7 * mm) - >>> (2.54*cm) - inch + >>> (2.54 * cm) - inch - >>> inch - (2.54*cm) + >>> inch - (2.54 * cm) - >>> (17*cm) - 7 + >>> (17 * cm) - 7 - >>> 17 - (7*cm) + >>> 17 - (7 * cm) @@ -128,11 +128,11 @@ class Unit(float): .. code-block:: python - >>> (3*mm) * 3 + >>> (3 * mm) * 3 - >>> 3 * (3*mm) + >>> 3 * (3 * mm) - >>> 3.5 * (3*mm) + >>> 3.5 * (3 * mm) Multiplication works either way round. @@ -142,7 +142,7 @@ class Unit(float): .. code-block:: python - >>> inch * (7*cm) + >>> inch * (7 * cm) Traceback (most recent call last): NotImplementedError: Multiplying a unit by another unit is not allowed. @@ -153,16 +153,16 @@ class Unit(float): .. code-block:: python - >>> (3*mm) / 3 + >>> (3 * mm) / 3 - >>> (10*mm) / 2.5 + >>> (10 * mm) / 2.5 Dividing by another unit results in a :exc:`NotImplementedError`: .. code-block:: python - >>> inch / (7*cm) + >>> inch / (7 * cm) Traceback (most recent call last): NotImplementedError: Dividing a unit by another unit is not allowed. @@ -171,7 +171,7 @@ class Unit(float): .. code-block:: python - >>> 3 / (3*mm) + >>> 3 / (3 * mm) Traceback (most recent call last): NotImplementedError: Dividing by a unit is not allowed. @@ -188,7 +188,7 @@ class Unit(float): .. code-block:: python - >>> (3*mm) % 2.5 + >>> (3 * mm) % 2.5 Dividing by a unit, or modulo division of two units, is not officially supported. diff --git a/domdf_python_tools/stringlist.py b/domdf_python_tools/stringlist.py index b50a82f..516398d 100644 --- a/domdf_python_tools/stringlist.py +++ b/domdf_python_tools/stringlist.py @@ -405,7 +405,7 @@ def with_indent(self, indent: Union[String, Indent], size: int = 0): >>> sl = StringList() >>> with sl.with_indent(" ", 1): - ... sl.append("Hello World") + ... sl.append("Hello World") :param indent: The :class:`~.Indent` to use within the ``with`` block, or the indent type. :param size: If ``indent`` is an indent type, the indent size to use within the ``with`` block. @@ -428,7 +428,7 @@ def with_indent_size(self, size: int = 0): >>> sl = StringList() >>> with sl.with_indent_size(1): - ... sl.append("Hello World") + ... sl.append("Hello World") :param size: The indent size to use within the ``with`` block. """ @@ -450,7 +450,7 @@ def with_indent_type(self, indent_type: str = '\t'): >>> sl = StringList() >>> with sl.with_indent_type(" "): - ... sl.append("Hello World") + ... sl.append("Hello World") :param indent_type: The type of indent to use within the ``with`` block. """ diff --git a/domdf_python_tools/words.py b/domdf_python_tools/words.py index d7dc7d8..dd74787 100644 --- a/domdf_python_tools/words.py +++ b/domdf_python_tools/words.py @@ -653,9 +653,9 @@ class PluralPhrase(NamedTuple): .. code-block:: python >>> phrase = PluralPhrase( - ... "The proposed {} {} to ...", - ... (Plural("change", "changes"), Plural("is", "are")) - ... ) + ... "The proposed {} {} to ...", + ... (Plural("change", "changes"), Plural("is", "are")), + ... ) >>> phrase(1) 'The proposed change is to ...' >>> phrase(2)