Skip to content

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:

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:
- @functools.total_ordering is not handled correctly, see
  astral-sh/ty#1202
- 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.

3 participants