Skip to content

build: apply ruff-format and black to more python files#12452

Merged
RayBB merged 2 commits into
internetarchive:masterfrom
ragini-pandey:build/apply-ruff-format-to-more-python-files
Apr 28, 2026
Merged

build: apply ruff-format and black to more python files#12452
RayBB merged 2 commits into
internetarchive:masterfrom
ragini-pandey:build/apply-ruff-format-to-more-python-files

Conversation

@ragini-pandey

Copy link
Copy Markdown
Contributor

Closes #12450

Reduces the ruff-format exclude: list and black files: list from 31 files to 12 files by removing entries no longer touched by open (non-draft) PRs. Both lists are kept in sync as required.

The 19 files removed from the exclusion list:

  • openlibrary/core/lists/model.py
  • openlibrary/plugins/openlibrary/bulk_tag.py
  • openlibrary/plugins/openlibrary/status.py
  • openlibrary/plugins/upstream/addbook.py
  • openlibrary/plugins/upstream/addtag.py
  • openlibrary/plugins/upstream/code.py
  • openlibrary/plugins/upstream/covers.py
  • openlibrary/plugins/upstream/jsdef.py
  • openlibrary/plugins/worksearch/schemes/__init__.py
  • openlibrary/plugins/worksearch/schemes/authors.py
  • openlibrary/plugins/worksearch/schemes/lists.py
  • openlibrary/plugins/worksearch/schemes/subjects.py
  • openlibrary/utils/form.py
  • openlibrary/utils/request_context.py
  • openlibrary/utils/schema.py
  • scripts/find_duplicate_author.py
  • scripts/monitoring/fail2ban_monitor.py
  • scripts/monitoring/monitor.py
  • scripts/update_stale_ocaid_references.py

Technical

Single commit updating only .pre-commit-config.yaml. CI will auto-format the 19 newly unexcluded Python files.

Testing

CI will run ruff-format and black on the newly included files and auto-format them, confirming the formatting changes are automatic with no extra manual edits.

Screenshot

N/A — no UI changes.

Stakeholders

@RayBB

Reduces the ruff-format exclude list and black files list from 31 to 12
files by removing entries no longer touched by open (non-draft) PRs.

Part of: internetarchive#12260
Closes internetarchive#12450
Copilot AI review requested due to automatic review settings April 28, 2026 05:05
@github-project-automation github-project-automation Bot moved this to Waiting Review/Merge from Staff in Ray's Project Apr 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates pre-commit formatting configuration to apply ruff-format/black to more Python files by shrinking the set of files temporarily excluded due to open PR activity, keeping the ruff-format exclude list and black include list in sync.

Changes:

  • Reduced the ruff-format exclude: regex list from 31 paths to 12.
  • Reduced the black files: regex list from 31 paths to 12 to match the ruff-format exclusions.

@mekarpeles

Copy link
Copy Markdown
Member

Thank you for this PR, @ragini-pandey! Welcome to Open Library — this appears to be your first contribution.

@RayBB is assigned to this PR and currently has:

  • 7 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 #NNN reference
    • Linked issue is triaged — has a Priority: * label (not just Needs: Triage)
    • Linked issue is assigned — has at least one assignee
  • Commit history clean — no WIP/fixup/conflict noise; commit messages are meaningful
  • CI passing — no failing check-runs
  • Test cases present — if the change touches substantive logic, test coverage exists or is explained
  • Proof of testing — PR body includes a description of what was tested, a screenshot, or a video

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.

@RayBB RayBB left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Excellent thank you!

@RayBB RayBB merged commit 4f31a91 into internetarchive:master Apr 28, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from Waiting Review/Merge from Staff to Done in Ray's Project Apr 28, 2026
Sadashii pushed a commit to Sadashii/openlibrary that referenced this pull request May 11, 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.

apply format rules to more python files

4 participants