Skip to content

Enable end-of-file-fixer for all file types in pre-commit#12331

Merged
RayBB merged 2 commits intointernetarchive:masterfrom
Saad259:fix-enable-end-of-file-fixer-all-types
Apr 9, 2026
Merged

Enable end-of-file-fixer for all file types in pre-commit#12331
RayBB merged 2 commits intointernetarchive:masterfrom
Saad259:fix-enable-end-of-file-fixer-all-types

Conversation

@Saad259
Copy link
Copy Markdown
Contributor

@Saad259 Saad259 commented Apr 9, 2026

Closes #12327

Technical

Updates pre-commit-config.yaml to enable the end-of-file-fixer hook for all file types, replacing the previous types_or: [python] restriction. Adds an exclude pattern for .po, .pot, .svg, .ini and .type files that should not be modified by the hook.

Testing

Run pre-commit run end-of-file-fixer --all-files and verify it runs across all file types without erroring on excluded files (SVG, po, pot, ini).

Screenshot

N/A no UI changes

Stakeholders

@RayBB

@github-project-automation github-project-automation Bot moved this to Waiting Review/Merge from Staff in Ray's Project Apr 9, 2026
@Saad259
Copy link
Copy Markdown
Contributor Author

Saad259 commented Apr 9, 2026

Hi @RayBB the pre-commit.ci bot was unable to auto-fix this PR with the message: "GitHub prevented pre-commit.ci from autofixing this PR due to autofixes to a workflow file". It does say 0 errors found so I'm not sure what exactly happened here. How would you like me to proceed?

@mekarpeles
Copy link
Copy Markdown
Member

Thanks for the PR, @Saad259!

🤖 Copilot has been assigned for an initial review.

@RayBB is assigned to this PR and currently has:

  • 3 open PR(s) of equal or higher priority to review first
PR triage checklist (maintainers / Pam)
  • PR description — not empty; explains what the change does and how to verify it
  • References an issue — PR body contains a #12327 reference
    • Linked issue is triaged — has Priority: 3
    • Linked issue is assigned — has at least one assignee
  • Commit history clean — single clean commit
  • CI passing — no failing check-runs
  • Test cases present — config-only change; no logic requires testing
  • Proof of testing — testing steps provided in PR body

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 from end-of-file-fixer so it runs across all applicable (text) files.
  • Added an exclude regex to skip .po, .pot, .svg, .ini, and .type files.

@RayBB RayBB force-pushed the fix-enable-end-of-file-fixer-all-types branch from aa0120b to f15c2df Compare April 9, 2026 17:39
Copy link
Copy Markdown
Collaborator

@RayBB RayBB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@RayBB RayBB merged commit e89dd75 into internetarchive:master Apr 9, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from Waiting Review/Merge from Staff to Done in Ray's Project Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Enable end-of-file fixer for all file types in pre-commit

4 participants