Skip to content
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

Adding typing annotations #1260

Open
kerneis-anssi opened this issue Sep 10, 2021 · 1 comment
Open

Adding typing annotations #1260

kerneis-anssi opened this issue Sep 10, 2021 · 1 comment
Assignees

Comments

@kerneis-anssi
Copy link
Contributor

I think a number of issues could be caught at compile type by adding gradual typing annotations to chipsec. I tried using pytype on chipset.py, but it issues a lot of spurious warnings because it would need TypedDict annotations to understand the content of the various Cfg arrays (which contain heterogeneous mappings from fixed strings to various types). We could also use mytype instead, I only tried the one I'm most familiar with.

I'd be willing to put in the effort but only if there is a chance to see it merged upstream. Is this something you would be interested in?

@frinzell
Copy link
Member

Short term, we still have to work with python 2.7 due to the EFI Shell implementation. Long term, we are actively looking at replacing this implementation with the recently added edk2-libc python 3.6.8 support. After the EFI Shell update to py3, we can look at Type Hints that work with 3.6.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants