Testing: Add type hints to utils.py and FilterEngine, refactoring code where needed #6604
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.
Part of #6588.
b3227b1
BaseClient
constructor is refactored in a way where the static type checker can detect thathost
andauth_host
are neverNone
.d5d3d67
utils.py
. The methods here are used in a few places, and there are some instances where the input types are unclear, so I addedtype: ignore
comments in places where the issue seems to be with the parent function rather than the util function. Some notes below.oidc.py
filter_engine.py
4d2808d
re.match(str(cfg_forced_modules), module_name)
ifmodule_name
isNone
.3fee6f7
parse_did_filter_from_string_fe
inutils.py
, which is then called inFilterEngine
. I added type hints all around to make it easier to understand which types were being passed inFilterEngine
, as well as refactoring some stuff where needed for type hinting purposes.