Skip to content

MNT Use Ruff and pre-commit for linting - #686

Open
Swapnil-byte-798 wants to merge 2 commits into
joblib:masterfrom
Swapnil-byte-798:maintenance/ruff-precommit
Open

Swapnil-byte-798 wants to merge 2 commits into
joblib:masterfrom
Swapnil-byte-798:maintenance/ruff-precommit

Conversation

@Swapnil-byte-798

Copy link
Copy Markdown

Fixes #684. Follows the Ruff and pre-commit setup in joblib/threadpoolctl#258 and joblib/threadpoolctl#269.

The locked Pixi lint task runs the same pre-commit checks available locally. Ruff checks Python errors and formats at the existing 79-character width. The vendored CPython resource tracker stays excluded from Ruff, including when pre-commit passes it by filename.

The lockfile changes are confined to the lint environment. The formatting and lint cleanup preserve the resource lifetimes in the backend tests.

Validation

  • pixi run --locked lint passed all nine hooks.
  • The Linux Python 3.13 backend, CPU-count, resource-tracker, and worker-timeout run reported 61 passed and 9 skipped. Four failures also occurred on the base commit, including denied socket operations. The patch run’s remaining timeout passed on an isolated retry.
  • git diff --check passed and the vendored resource tracker is byte-identical.

Codex assisted with the implementation and local validation.

Use the same pre-commit configuration locally and in the locked Pixi lint task. Preserve the formatting width and skip vendored CPython source.

Co-authored-by: Codex <codex@openai.com>
Copilot AI balanced review requested due to automatic review settings November 11, 2026 18:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Keep the Unix virtual-package entries in the form written by Pixi 0.82.0.

Co-authored-by: Codex <codex@openai.com>

This branch has not been deployed

No deployments
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.

MNT Switch to ruff instead of black and add pre-commit setup

2 participants