Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use ruff instead of black / flake8 / isort across RAPIDS #130

Open
27 tasks
jameslamb opened this issue Dec 30, 2024 · 2 comments
Open
27 tasks

use ruff instead of black / flake8 / isort across RAPIDS #130

jameslamb opened this issue Dec 30, 2024 · 2 comments

Comments

@jameslamb
Copy link
Member

jameslamb commented Dec 30, 2024

Description

ruff is a fast, actively-maintained static analysis tool that implements a TON of linting rules, including those from isort, flake8, and 20+ flake8-* extensions.

ref: https://docs.astral.sh/ruff/rules/#legend

ruff-format can also perform auto-formatting of Python code, similar to black.

Every RAPIDS repo should use ruff, and stop using black, isort and flake8.

Benefits of this work

Acceptance Criteria

  • ruff is used in all RAPIDS repos
  • black is not used directly in any RAPIDS repos
  • flake8 is not used directly in any RAPIDS repos
  • isort is not used directly in any RAPIDS repos
  • all ruff configuration is stored in pyproject.toml files

Notes

Motivating discussions:

Approach

These updates can be done in any order, since they're self-contained to individual repos.
When porting configuration to ruff, try to match the project's existing style preferences to minimize style-related changes.

Updates

Preview Give feedback
@jameslamb jameslamb changed the title use ruff instead of flake8 / isort across RAPIDS use ruff instead of black / flake8 / isort across RAPIDS Dec 30, 2024
@vyasr
Copy link
Contributor

vyasr commented Dec 30, 2024

Be aware that some repositories may value isort's sorting of Cython files, which ruff does not yet do (see discussion in astral-sh/ruff#1079 and astral-sh/ruff#10250). We chose to accept this in cudf, see rapidsai/cudf#14882 (comment).

@jameslamb
Copy link
Member Author

Thanks for that note and for the ruff links! @bdice mentioned that as well in rapidsai/cuspatial#1509 (comment)

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

No branches or pull requests

2 participants