Enable end-of-file-fixer for all file types in pre-commit#12331
Enable end-of-file-fixer for all file types in pre-commit#12331RayBB merged 2 commits intointernetarchive:masterfrom
Conversation
|
Hi @RayBB the |
|
Thanks for the PR, @Saad259! 🤖 Copilot has been assigned for an initial review. @RayBB is assigned to this PR and currently has:
PR triage checklist (maintainers / Pam)
Note This comment was automatically generated by Pam, Open Library's Project AI Manager, on behalf of @mekarpeles. Pam is designed to provide status visibility, perform basic project management functions and relevant codebase research, and provide actionable feedback so contributors aren't left waiting. |
There was a problem hiding this comment.
Pull request overview
Updates the repository’s pre-commit configuration so the end-of-file-fixer hook applies broadly (not just Python), reducing diff noise from missing final newlines while avoiding known file types that shouldn’t be touched.
Changes:
- Removed the
types_or: [python]restriction fromend-of-file-fixerso it runs across all applicable (text) files. - Added an
excluderegex to skip.po,.pot,.svg,.ini, and.typefiles.
aa0120b to
f15c2df
Compare
RayBB
left a comment
There was a problem hiding this comment.
Thanks for working on this!
I went through and confirmed that all the files that are changing are not breaking any standards (aka there are similar files in the codebase that have a newline). So no files are changed in a way that makes them out of step with other files.
Fun additional reading about why the newline is good:
https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline
Closes #12327
Technical
Updates
pre-commit-config.yamlto enable theend-of-file-fixerhook for all file types, replacing the previoustypes_or: [python]restriction. Adds an exclude pattern for.po,.pot,.svg,.iniand.typefiles that should not be modified by the hook.Testing
Run
pre-commit run end-of-file-fixer --all-filesand verify it runs across all file types without erroring on excluded files (SVG, po, pot, ini).Screenshot
N/A no UI changes
Stakeholders
@RayBB