Skip to content

Lint Tools/build using existing ruff configuration #132390

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

Closed
picnixz opened this issue Apr 11, 2025 · 2 comments
Closed

Lint Tools/build using existing ruff configuration #132390

picnixz opened this issue Apr 11, 2025 · 2 comments
Assignees
Labels
build The build process and cross-build infra CI, GitHub Actions, buildbots, Dependabot, etc. type-feature A feature request or enhancement

Comments

@picnixz
Copy link
Member

picnixz commented Apr 11, 2025

Feature or enhancement

Proposal:

There is an existing Tools/build/.ruff.toml that is for now only used by the check-warnings.py script. I've tried to minimize the number of changes but I ran ruff check Tools/build and selectively disabled some existing errors so that in the future we can selectively fix them.

Note that @hugovk recently ruffed the tools in #124382 but not all of them.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

@picnixz picnixz added build The build process and cross-build infra CI, GitHub Actions, buildbots, Dependabot, etc. type-feature A feature request or enhancement labels Apr 11, 2025
@picnixz picnixz self-assigned this Apr 11, 2025
@picnixz picnixz changed the title Correct lint Tools/build using existing ruff configuration Lint Tools/build using existing ruff configuration Apr 11, 2025
picnixz added a commit that referenced this issue Apr 20, 2025
@picnixz picnixz closed this as completed Apr 20, 2025
@picnixz
Copy link
Member Author

picnixz commented Apr 20, 2025

@encukou I've just seen your disapproval on this one. I eventually only changed some lines either for readability or because there were usage of deprecated features (such as using typing.* instead of known generics). If you want some of your owned files to be removed from the list of ruffed ones, feel free to make a follow-up PR.

@encukou
Copy link
Member

encukou commented Apr 29, 2025

No one has "owned" files here.
But as the main author of stable_abi.py, I do dislike the arbitrary formatting decisions. I'd prefer avoiding style-only changes, and sticking to PEP 8 if they're really necessary.
Also, from my experience with Ruff in CI, the failure messages can be rather opaque.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build infra CI, GitHub Actions, buildbots, Dependabot, etc. type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants