Skip to content

Fix pre-commit hook end-of-file-fixer interfering with CI.#2320

Merged
JelleZijlstra merged 2 commits into
python:mainfrom
randolf-scholz:fix_pre_commit_eof_fixer_interfering_with_conformance
Jul 11, 2026
Merged

Fix pre-commit hook end-of-file-fixer interfering with CI.#2320
JelleZijlstra merged 2 commits into
python:mainfrom
randolf-scholz:fix_pre_commit_eof_fixer_interfering_with_conformance

Conversation

@randolf-scholz

@randolf-scholz randolf-scholz commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Encountered this in https://github.com/python/typing/actions/runs/29147006108/job/86530507754: uv run --python 3.12 --frozen python src/main.py produces results.html without trailing newline, which then gets added by end-of-file-fixer, which then causes Assert conformance results are up to date CI to fail.

  1. excluded conformance/results/results.html from end-of-file-fixer
    Set keep_trailing_newline=True in jinja2.Environment in reporting.py
  2. ran pre-commit run -a which applied end-of-file-fixer and trailing-whitespace to some files.

…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.
@srittau

srittau commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

I think we should rather fix base.html to include a final end-of-line.

@randolf-scholz

Copy link
Copy Markdown
Contributor Author

@srittau base.html already had a trailing newline, but it was possible to fix by setting keep_trailing_newline=True in jinja2.Environment.

@JelleZijlstra JelleZijlstra merged commit 6ef9f77 into python:main Jul 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants