SCons: Add unobtrusive type hints in SCons files #93058
Open
+281
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.