Skip to content

tc-build: Switch to ruff for Python formatting#325

Merged
nathanchance merged 1 commit intoClangBuiltLinux:mainfrom
nathanchance:ruff-format
Mar 25, 2026
Merged

tc-build: Switch to ruff for Python formatting#325
nathanchance merged 1 commit intoClangBuiltLinux:mainfrom
nathanchance:ruff-format

Conversation

@nathanchance
Copy link
Copy Markdown
Member

We started using ruff for linting a while ago. Since then, it has grown a formatting option, which is quite fast. While it is a little less flexible than yapf, we don't customize it much other than style and line length, the latter of which ruff also allows us to customize.

Switch to ruff for formatting. Most of the changes end up making the code a little more readable, at the expense of some extra lines. Switch to the generic fmt comments instead of the yapf specific ones. Use the option to preserve our quoting style, which uses single quotes for string literals and double quotes for f-string or raw strings.

NOTE: The linting job will not succeed until ClangBuiltLinux/actions-workflows#11 is merged.

@nathanchance nathanchance requested a review from msfjarvis as a code owner March 25, 2026 00:22
We started using ruff for linting a while ago. Since then, it has grown
a formatting option, which is quite fast. While it is a little less
flexible than YAPF, we don't customize it much other than style and line
length, the latter of which ruff also allows us to customize.

Switch to ruff for formatting. Most of the changes end up making the
code a little more readable, at the expense of some extra lines. Switch
to the generic fmt comments instead of the yapf specific ones. Use the
option to preserve our quoting style, which uses single quotes for
string literals and double quotes for f-string or raw strings.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
@nathanchance nathanchance merged commit 1c6c33b into ClangBuiltLinux:main Mar 25, 2026
8 checks passed
@nathanchance nathanchance deleted the ruff-format branch March 25, 2026 04:00
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.

2 participants