From d5c803333a32862a78b34ee051bc695b41eaae12 Mon Sep 17 00:00:00 2001 From: Vladimir Iglovikov Date: Fri, 18 Sep 2026 10:26:58 +0300 Subject: [PATCH 1/2] style: clarify generated markdown strings --- imread_benchmark/analysis/fodb_paper.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/imread_benchmark/analysis/fodb_paper.py b/imread_benchmark/analysis/fodb_paper.py index f055409..ffc81c7 100644 --- a/imread_benchmark/analysis/fodb_paper.py +++ b/imread_benchmark/analysis/fodb_paper.py @@ -960,9 +960,11 @@ def _summary_markdown(evidence: dict[str, Any]) -> str: "", "## Compatibility audit", "", - "The empty-DHT test measures recovery from one malformed bitstream pattern. " - "The four-component test measures conversion to the normalized three-channel RGB contract; " - "the sentinel is not classified as corrupt.", + ( + "The empty-DHT test measures recovery from one malformed bitstream pattern. " + "The four-component test measures conversion to the normalized three-channel RGB contract; " + "the sentinel is not classified as corrupt." + ), "", "| Decoder | Empty-DHT bitstreams | Four-component RGB | Combined |", "| --- | ---: | ---: | ---: |", @@ -981,8 +983,10 @@ def _summary_markdown(evidence: dict[str, Any]) -> str: "", "## Protocol decision", "", - "| Workload | Platform | Decode leader | Loader leader | Workers | Regret | " - "Spearman rho | Top 10% throughput group |", + ( + "| Workload | Platform | Decode leader | Loader leader | Workers | Regret | " + "Spearman rho | Top 10% throughput group |" + ), "| --- | --- | --- | --- | ---: | ---: | ---: | --- |", ], ) From 3f55168562d4f805a76754ba8458b259c27e250b Mon Sep 17 00:00:00 2001 From: Vladimir Iglovikov Date: Fri, 18 Sep 2026 10:36:49 +0300 Subject: [PATCH 2/2] chore: strengthen pre-commit quality gates --- .pre-commit-config.yaml | 37 +++++++++++++++++++++++++++++-------- pyproject.toml | 16 ++++++++++------ 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index db83f62..3aa8162 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,6 +26,8 @@ repos: - id: check-symlinks - id: check-toml - id: check-xml + - id: check-json + - id: check-merge-conflict - id: detect-private-key - id: forbid-new-submodules - id: forbid-submodules @@ -43,15 +45,28 @@ repos: exclude: \.json$ - id: requirements-txt-fixer + - repo: https://github.com/ternaus/ruff-policy-hooks + rev: v0.4.0 + hooks: + - id: check-ruff-suppressions + name: Protect mandatory Ruff complexity diagnostics + args: [--protect=C901,PLR0911,PLR0912,PLR0913,PLR0915,PLR0917] + - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.12 + rev: v0.16.8 hooks: - - id: ruff + - id: ruff-check args: [--fix] - id: ruff-format + - repo: https://github.com/asottile/pyupgrade + rev: v3.21.2 + hooks: + - id: pyupgrade + args: [--py311-plus] + - repo: https://github.com/astral-sh/uv-pre-commit - rev: 0.11.8 + rev: 0.12.16 hooks: - id: uv-lock @@ -64,19 +79,25 @@ repos: - id: text-unicode-replacement-char - repo: https://github.com/codespell-project/codespell - rev: v2.4.2 + rev: v2.4.3 hooks: - id: codespell - additional_dependencies: ["tomli"] + additional_dependencies: ["tomli>=2.4.1"] exclude: \.json$ + - repo: https://github.com/ternaus/opencv-rgb-precommit + rev: v0.1.1 + hooks: + - id: check-opencv-rgb + - repo: https://github.com/tox-dev/pyproject-fmt - rev: "v2.21.1" + rev: "v2.29.4" hooks: - id: pyproject-fmt + args: [--max-supported-python=3.14] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.20.2 + rev: v2.3.1 hooks: - id: mypy files: ^imread_benchmark/ @@ -84,7 +105,7 @@ repos: args: [--config-file=pyproject.toml] - repo: https://github.com/shellcheck-py/shellcheck-py - rev: v0.11.0.1 + rev: v0.11.0.1-1 hooks: - id: shellcheck args: [--severity=warning] diff --git a/pyproject.toml b/pyproject.toml index e757294..81d79ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,9 @@ optional-dependencies.plot = [ "matplotlib>=3.8", "seaborn>=0.13" ] optional-dependencies.tensorflow = [ "tensorflow" ] scripts.imread-benchmark = "imread_benchmark.cli:app" entry-points."imread_benchmark.decoders".ajpegli = "imread_benchmark.decoders.ajpegli_decoder:AJpegliDecoder" -entry-points."imread_benchmark.decoders".imagecodecs = "imread_benchmark.decoders.imagecodecs_decoder:ImageCodecsDecoder" +entry-points."imread_benchmark.decoders".imagecodecs = """\ + imread_benchmark.decoders.imagecodecs_decoder:ImageCodecsDecoder\ + """ entry-points."imread_benchmark.decoders".imageio = "imread_benchmark.decoders.imageio_decoder:ImageIODecoder" entry-points."imread_benchmark.decoders".jpeg4py = "imread_benchmark.decoders.jpeg4py_decoder:Jpeg4pyDecoder" entry-points."imread_benchmark.decoders".kornia = "imread_benchmark.decoders.kornia_decoder:KorniaDecoder" @@ -64,7 +66,9 @@ entry-points."imread_benchmark.decoders".pyvips = "imread_benchmark.decoders.pyv entry-points."imread_benchmark.decoders".simplejpeg = "imread_benchmark.decoders.simplejpeg_decoder:SimpleJpegDecoder" entry-points."imread_benchmark.decoders".skimage = "imread_benchmark.decoders.skimage_decoder:SkimageDecoder" entry-points."imread_benchmark.decoders".tensorflow = "imread_benchmark.decoders.tensorflow_decoder:TensorFlowDecoder" -entry-points."imread_benchmark.decoders".torchvision = "imread_benchmark.decoders.torchvision_decoder:TorchvisionDecoder" +entry-points."imread_benchmark.decoders".torchvision = """\ + imread_benchmark.decoders.torchvision_decoder:TorchvisionDecoder\ + """ entry-points."imread_benchmark.decoders".turbojpeg = "imread_benchmark.decoders.turbojpeg_decoder:TurboJPEGDecoder" [dependency-groups] @@ -178,13 +182,13 @@ lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" [tool.mypy] ignore_missing_imports = true follow_imports = "silent" -warn_redundant_casts = true -warn_unused_ignores = true disallow_any_generics = true -check_untyped_defs = true -no_implicit_reexport = true disallow_untyped_defs = true +check_untyped_defs = true +warn_redundant_casts = true +warn_unused_ignores = true overrides = [ { module = [ "skimage.*", "tifffile.*" ], follow_imports = "skip" } ] +no_implicit_reexport = true [tool.pytest] ini_options.testpaths = [ "tests" ]