Skip to content

Replace isort/black with ruff - #11984

Merged
RAMitchell merged 3 commits into
dmlc:masterfrom
RAMitchell:ruff
Feb 4, 2026
Merged

Replace isort/black with ruff#11984
RAMitchell merged 3 commits into
dmlc:masterfrom
RAMitchell:ruff

Conversation

@RAMitchell

Copy link
Copy Markdown
Member

No description provided.

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

This PR updates the Python formatting and import-sorting tooling used in pre-commit, replacing the previous Black/isort hooks with Ruff equivalents and slightly tightening Python linting scope.

Changes:

  • Add ruff-check and ruff-format hooks via astral-sh/ruff-pre-commit and configure them to run on Python files while excluding dmlc-core and gputreeshap.
  • Remove the custom black and isort pre-commit hooks that previously handled Python formatting and import sorting.
  • Update the pylint pre-commit hook to exclude the tests/ tree in addition to existing exclusions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .pre-commit-config.yaml Outdated
Comment thread .pre-commit-config.yaml
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: mixed-line-ending
- repo: https://github.com/astral-sh/ruff-pre-commit

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does it know where to look for configuration? pyproject.toml

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I believe it does find it automatically.

@RAMitchell
RAMitchell merged commit 7852a48 into dmlc:master Feb 4, 2026
78 checks passed
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.

3 participants