-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Mypy conformance for FabricAdmin and CertificateAuthority #39920
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: master
Are you sure you want to change the base?
Mypy conformance for FabricAdmin and CertificateAuthority #39920
Conversation
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.
Code Review
This pull request improves mypy conformance for FabricAdmin
and CertificateAuthority
by adding Optional
to type hints where appropriate, which is a good improvement. The changes look solid. I've only found a minor typo in a docstring that should be corrected.
''' Initializes the manager. | ||
|
||
chipStack: Reference to a chip.ChipStack object that is used to initialize | ||
CertificateAuthority instances. | ||
|
||
persistentStorage: If provided, over-rides the default instance in the provided chipStack | ||
persistentStorage: And optional reference to persistentStorage, if provided, |
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.
There's a typo in the docstring. "And" should be "An".1
Style Guide References
persistentStorage: And optional reference to persistentStorage, if provided, | |
persistentStorage: An optional reference to persistentStorage, if provided, |
Footnotes
PR #39920: Size comparison from 5dc7824 to 5669221 Full report (69 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nxp, psoc6, qpg, stm32, telink, tizen)
|
Summary
Make whl files conformant to mypy
Search in build files *py files wich make the whl files.
grep -i ".*\.py" ./src/controller/python/BUILD.gn | grep -v py_scripts > files_mypy.txt
Found several py files which make the whl file and evaluate them with mypy.
cat files_mypy.txt | grep -v "clusters/Objects.py" | xargs -I {} mypy --config-file=src/python_testing/matter_testing_infrastructure/mypy.ini {} > mypy_whl.log
Clean the results:
cat mypy_results.log | sort | uniq | grep -iv "success" > mypy_results_filtered.txt
Find unique files to work on this issue:
cat mypy_results_filtered.txt | cut -d ":" -f1 | uniq > my_py_results_filtered_affected_files.py
In this PR is going to cover the following files as the first part:
Related issues
#37750
Testing
Verify the files with mypy and confirm the file does not contain issues.