-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
SCons: Add unobtrusive type hints in SCons files #93058
Conversation
9ae0139
to
6dd66cd
Compare
Made a slight adjustment to no longer need the |
6dd66cd
to
1576370
Compare
66d1a87
to
70ca8fe
Compare
With the belated due-date of 4.3 & largely indirect nature of this implementation, this felt like a safe milestone adjustment. Feel free to revert if this feels out-of-scope. |
70ca8fe
to
5923392
Compare
5923392
to
9f9ee0c
Compare
Looks good to me. I'd just like to confirm that this stays fully optional, and not something we plan to enforce with more CI checks in the future. Third-party modules or platforms might have their own SCsub files which may or may not be updated to match the changes in this PR, and we don't want to break them. |
It'd be 100% optional. I'll still make an effort to ensure every SCons file within the main repo uses it, but that should all be manageable manually. |
The best point of comparison I can give is it's equivalent to the |
Thanks! |
SConstruct
/SCsub
files #86213ruff
SConstruct/SCsub fixes #92264This PR adds
scons_hints.py
to the repo, which grants intellisense logic to all SCons files. Like #86213, this doesn't change any of the script files themselves outside of the include statement; however, the actual line is even more compact & setup to play nice with our newruff
formatter. Now all SCons files will have this header:No space after the shebang is deliberate, as this new line is effectively metadata.
The comments at the end are to disable a warning for a star import (not added to(EDIT: Removed comments; logic handled entirely bypyproject.toml
, as this should be warned about for all other cases) & to not account for this line when performingisort
pyproject.toml
). Opted to put the hint file inmisc/utility
to avoid cluttering the root, and the added verbosity helps the line feel more "no-touchy".The only other changes were making
isort
automatically put the metadata import on top & adjusting theper-file-ignores
for SCons files:F821
(Undefined name) was removed, as now all the names are properly defined.F403
(Import star) was added, as this setup relies on the import star syntax.F405
(Import star variable) was added, same as above.