From d71b574cf09f65772dec612423517462f72c3a18 Mon Sep 17 00:00:00 2001 From: Randolf Scholz Date: Sat, 11 Jul 2026 11:51:18 +0200 Subject: [PATCH 1/2] 1. excluded conformance/results/results.html from end-of-file-fixer (interferes with "Assert conformance results are up to date" workflow) 2. ran `pre-commit run -a` which applied "end-of-file-fixer" and "trailing-whitespace" to some files. --- .pre-commit-config.yaml | 1 + conformance/tests/enums_definition.py | 1 - conformance/tests/overloads_basic.py | 1 - conformance/tests/overloads_consistency.py | 1 - docs/spec/callables.rst | 2 +- 5 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 61b8f596b..6d1f20217 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,6 +5,7 @@ repos: - id: trailing-whitespace exclude: conformance/results/.*/.*\.toml - id: end-of-file-fixer + exclude: conformance/results/results\.html - id: check-yaml - id: check-toml - id: check-merge-conflict diff --git a/conformance/tests/enums_definition.py b/conformance/tests/enums_definition.py index 480a06510..955618ddf 100644 --- a/conformance/tests/enums_definition.py +++ b/conformance/tests/enums_definition.py @@ -90,4 +90,3 @@ class Color12(Enum): assert_type(Color12.RED, Literal[Color12.RED]) assert_type(Color12.GREEN, Literal[Color12.GREEN]) Color12.BLUE # E - diff --git a/conformance/tests/overloads_basic.py b/conformance/tests/overloads_basic.py index 7aee51d87..51f722dbe 100644 --- a/conformance/tests/overloads_basic.py +++ b/conformance/tests/overloads_basic.py @@ -58,4 +58,3 @@ def map( def map(func: Any, iter1: Any, iter2: Any = ...) -> Any: raise NotImplementedError - diff --git a/conformance/tests/overloads_consistency.py b/conformance/tests/overloads_consistency.py index 58533c125..540e0146a 100644 --- a/conformance/tests/overloads_consistency.py +++ b/conformance/tests/overloads_consistency.py @@ -115,4 +115,3 @@ def decorated(x: str, /) -> str: @_deco_2 def decorated(y: bytes, z: bytes) -> bytes: return b"" - diff --git a/docs/spec/callables.rst b/docs/spec/callables.rst index a4028aae8..f23220400 100644 --- a/docs/spec/callables.rst +++ b/docs/spec/callables.rst @@ -453,7 +453,7 @@ a function within a type expression. The syntax is Parameters specified using ``Callable`` are assumed to be positional-only. The ``Callable`` form provides no way to specify keyword-only parameters, -or default argument values. For these use cases, see the section on +or default argument values. For these use cases, see the section on `Callback protocols`_. Meaning of ``...`` in ``Callable`` From c4a6c0f5d762da749c1c707651b6550755b96aa2 Mon Sep 17 00:00:00 2001 From: Randolf Scholz Date: Sat, 11 Jul 2026 15:33:49 +0200 Subject: [PATCH 2/2] instead of ingoring results.html in end-of-file fixer, tell jinja to keep trailing newline --- .pre-commit-config.yaml | 1 - conformance/results/results.html | 3 ++- conformance/src/reporting.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6d1f20217..61b8f596b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,6 @@ repos: - id: trailing-whitespace exclude: conformance/results/.*/.*\.toml - id: end-of-file-fixer - exclude: conformance/results/results\.html - id: check-yaml - id: check-toml - id: check-merge-conflict diff --git a/conformance/results/results.html b/conformance/results/results.html index aa2fa2891..a236e7b95 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -234,6 +234,7 @@ border-color: inherit; } } + @@ -2827,4 +2828,4 @@

Python Type System Conformance Test Results

selector.value = localStorage.getItem("color-scheme") ?? "auto"; - \ No newline at end of file + diff --git a/conformance/src/reporting.py b/conformance/src/reporting.py index 63e2fd1f7..41b5949e5 100644 --- a/conformance/src/reporting.py +++ b/conformance/src/reporting.py @@ -58,6 +58,7 @@ def generate_summary(root_dir: Path): env = jinja2.Environment( loader=jinja2.FileSystemLoader(root_dir.joinpath("src/templates")), autoescape=jinja2.select_autoescape(), + keep_trailing_newline=True, ) env.filters["conformance_class"] = _conformance_class