NVIDIA / NVIDIA/cudf

[FEA] Consolidate python code-style checking and formatting to just use `ruff`

Open
#14,882 7 comments 1 reaction 0 assignees View on GitHub
feature request Python
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Is your feature request related to a problem? Please describe.**

We have already migrated to using [ruff](https://docs.astral.sh/ruff/) to replace flake8 and pyflakes. A previous barrier to using ruff's `isort` lint was lack of support for custom sections, [that is now supported](https://docs.astral.sh/ruff/settings/#isort-sections). Similarly, `ruff format` (which produces effectively black-compatible formatting) is now in "stable" beta and very usable.

We should consider migrating the separate `isort` and `black` configs to use `ruff check --fix` and `ruff format` respectively.

The advantage here is that ruff is orders of magnitude faster than both isort and black. For those of us that use format-on-save this is a significant quality of life improvement (formatting a large python file when editing cudf can easily take a few seconds with black).

We would also reduce our tool configuration options.

We might also at the same time consider increasing the default line length from the current (somewhat miserly) 79 characters.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.