From c2142447e9a7e7f74a5ead59ba4f12e29e35ed80 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Wed, 17 Sep 2025 16:55:47 +0100 Subject: [PATCH 1/4] Commit --- .pre-commit-config.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2e0e67e728490a..96a0a988014d5f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -91,6 +91,34 @@ repos: args: [--enable=default-role] files: ^Doc/|^Misc/NEWS.d/ + - repo: https://github.com/oxipng/oxipng + rev: v9.1.5 + hooks: + - id: oxipng + args: [ "-o", "2", "--strip", "safe", "--alpha" ] + exclude: | + (?x)^( + PC/icons/[^/]*\.png| + Android/testbed/app/src/main/res/drawable-xxhdpi/ic_launcher\.png| + Objects/object_layout_[^/]*\.png| + InternalDocs/images/python-cyclic-gc-[^/]*-new-page\.png| + Doc/howto/logging_flow\.png| + Doc/library/pathlib-inheritance\.png| + Doc/library/tk_msg\.png| + Doc/library/hashlib-blake2-tree\.png| + Doc/library/turtle-star\.png| + Doc/library/kde_example\.png| + Doc/using/mac_installer_09_custom_install_free_threaded\.png| + Doc/using/win_install_freethreaded\.png| + Doc/using/win_installer\.png| + Doc/using/mac_installer_[^/]*\.png| + Tools/msi/bundle/SideBar\.png| + Lib/profiling/sampling/_assets/python-logo-only\.png| + Lib/test/tkinterdata/python\.png| + Lib/test/test_email/data/python\.png| + Lib/idlelib/Icons/idle_[^/]*\.png| + )$ + - repo: local hooks: - id: blurb-no-space-c-api From c2506ce5ffc857e58a01bd36995fc85c69cba183 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Wed, 17 Sep 2025 16:58:02 +0100 Subject: [PATCH 2/4] Commit --- .pre-commit-config.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 96a0a988014d5f..5bd21feb93c2ea 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -108,9 +108,7 @@ repos: Doc/library/hashlib-blake2-tree\.png| Doc/library/turtle-star\.png| Doc/library/kde_example\.png| - Doc/using/mac_installer_09_custom_install_free_threaded\.png| - Doc/using/win_install_freethreaded\.png| - Doc/using/win_installer\.png| + Doc/using/win_install[^/]*\.png| Doc/using/mac_installer_[^/]*\.png| Tools/msi/bundle/SideBar\.png| Lib/profiling/sampling/_assets/python-logo-only\.png| From 2ee9bf9c0a23efbc0ac753a7dca0a4f3f818663f Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Mon, 29 Sep 2025 16:35:19 +0100 Subject: [PATCH 3/4] Apply suggestions from code review Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- .pre-commit-config.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5bd21feb93c2ea..2fa350ab604d59 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -95,26 +95,26 @@ repos: rev: v9.1.5 hooks: - id: oxipng - args: [ "-o", "2", "--strip", "safe", "--alpha" ] + args: [--strip=safe, --alpha] exclude: | (?x)^( - PC/icons/[^/]*\.png| Android/testbed/app/src/main/res/drawable-xxhdpi/ic_launcher\.png| - Objects/object_layout_[^/]*\.png| - InternalDocs/images/python-cyclic-gc-[^/]*-new-page\.png| Doc/howto/logging_flow\.png| + Doc/library/hashlib-blake2-tree\.png| + Doc/library/kde_example\.png| Doc/library/pathlib-inheritance\.png| Doc/library/tk_msg\.png| - Doc/library/hashlib-blake2-tree\.png| Doc/library/turtle-star\.png| - Doc/library/kde_example\.png| - Doc/using/win_install[^/]*\.png| Doc/using/mac_installer_[^/]*\.png| - Tools/msi/bundle/SideBar\.png| + Doc/using/win_install[^/]*\.png| + InternalDocs/images/python-cyclic-gc-[^/]*-new-page\.png| + Lib/idlelib/Icons/idle_[^/]*\.png| Lib/profiling/sampling/_assets/python-logo-only\.png| - Lib/test/tkinterdata/python\.png| Lib/test/test_email/data/python\.png| - Lib/idlelib/Icons/idle_[^/]*\.png| + Lib/test/tkinterdata/python\.png| + Objects/object_layout_[^/]*\.png| + PC/icons/[^/]*\.png| + Tools/msi/bundle/SideBar\.png| )$ - repo: local From db82a4b304ae2140dc20fe033743e53ab204b954 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Mon, 29 Sep 2025 16:40:09 +0100 Subject: [PATCH 4/4] Move & add comment --- .pre-commit-config.yaml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2fa350ab604d59..da343eb4925e35 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -84,18 +84,12 @@ repos: hooks: - id: zizmor - - repo: https://github.com/sphinx-contrib/sphinx-lint - rev: v1.0.0 - hooks: - - id: sphinx-lint - args: [--enable=default-role] - files: ^Doc/|^Misc/NEWS.d/ - - repo: https://github.com/oxipng/oxipng rev: v9.1.5 hooks: - id: oxipng args: [--strip=safe, --alpha] + # Exclude all existing pngs exclude: | (?x)^( Android/testbed/app/src/main/res/drawable-xxhdpi/ic_launcher\.png| @@ -117,6 +111,13 @@ repos: Tools/msi/bundle/SideBar\.png| )$ + - repo: https://github.com/sphinx-contrib/sphinx-lint + rev: v1.0.0 + hooks: + - id: sphinx-lint + args: [--enable=default-role] + files: ^Doc/|^Misc/NEWS.d/ + - repo: local hooks: - id: blurb-no-space-c-api