← 输入框|github.com|刷新
Skip to content

Fix autoupdate parsing without trailing newline - #3784

Closed
Niranjan-png wants to merge 6 commits into
pre-commit:mainfrom
Niranjan-png:fix/autoupdate-final-newline
Closed

Niranjan-png wants to merge 6 commits into
pre-commit:mainfrom
Niranjan-png:fix/autoupdate-final-newline

Conversation

@Niranjan-png

Copy link
Copy Markdown

Fixes issue #3768 where autoupdate drops comments when the rev line is last and the file has no final newline. The regex REV_LINE_RE in autoupdate.py was updated to allow missing final newline by changing to . Added regression test covering LF, CRLF, missing final newline, and final newline cases.

@asottile asottile closed this Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants