-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
gh-141376: make smelly: List all symbols, repeat smelly ones at end #141394
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
base: main
Are you sure you want to change the base?
Conversation
|
@AA-Turner @hugovk How can I inform precommit that |
vstinner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of colors, I would prefer to not print each tested binary unless if has "smelly" symbols.
Add this to diff --git a/Tools/build/.ruff.toml b/Tools/build/.ruff.toml
index 996f725fdcb..e7852abe131 100644
--- a/Tools/build/.ruff.toml
+++ b/Tools/build/.ruff.toml
@@ -31,6 +31,9 @@ ignore = [
"PYI025", # Use `from collections.abc import Set as AbstractSet`
]
+[lint.isort]
+extra-standard-library = ["_colorize"]
+
[lint.per-file-ignores]
"{check_extension_modules,freeze_modules}.py" = [
"UP031", # Use format specifiers instead of percent formatDocs: https://docs.astral.sh/ruff/settings/#lint_isort_extra-standard-library And note it'll stick it first in the stdlib import list. |
First gather data, then present the results.
|
@hugovk, thanks! Maybe I'll not need it here but hopefully I'll remember next time. @vstinner, would you be OK with something like https://github.com/encukou/cpython/blob/make-smelly-refactor/Tools/build/smelly.py ? |
Yes, something like that 👍 |
|
OK; I've changed the script to instead:
This way it's fine without colours! |
|
This version includes removing exceptions (as in #141392). |
Oh. I expected the opposite: only display smelly symbols and be silent if a binary has no smelly symbols.
|
|
It's more verbose, but that part scrolls up on a terminal; the important part is at the end so it stays visible. |
Without colours, the script's output hard to scan for my spoiled eyes.
The messages are adjusted to no longer imply a lack of exceptions to the rules.
(This PR is not tightly related to #141376 but I think it's best to attach it to that issue.)