Skip to content

Comments

Add experimental type checks with ty#97

Open
robin-nitrokey wants to merge 1 commit intomainfrom
ty
Open

Add experimental type checks with ty#97
robin-nitrokey wants to merge 1 commit intomainfrom
ty

Conversation

@robin-nitrokey
Copy link
Member

This patch prepares the repository for type checks with ty and adds an experimental CI job that runs the checks.

ty detected these problems in the current code:

  • TrussedBootloaderNrf52.update renamed an argument while overriding TrussedBootloader.update
  • Some ConfigFieldType functions did not handle unexpected variants. Ideally, we would use typing.assert_never here, but this has only been added in Python 3.11.
  • logger.warn is deprecated in favor of logger.warning.

We still have to ignore these false-positives:

@robin-nitrokey
Copy link
Member Author

ty v0.0.12 fixes the problem with functools.total_ordering.

This patch prepares the repository for type checks with ty and adds an
experimental CI job that runs the checks.

ty detected these problems in the current code:
- TrussedBootloaderNrf52.update renamed an argument while overriding
  TrussedBootloader.update
- Some ConfigFieldType functions did not handle unexpected variants.
  Ideally, we would use typing.assert_never here, but this has only
  been added in Python 3.11.
- logger.warn is deprecated in favor of logger.warning.

We still have to ignore these false-positives:
- Some imports from fake-winreg are not handled correctly, but this
  could also be a problem with fake-winreg.
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

Successfully merging this pull request may close these issues.

2 participants