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

Add "-> None" to methods without other types #961

Merged
merged 1 commit into from
Jul 4, 2023

Conversation

benhoyt
Copy link
Collaborator

@benhoyt benhoyt commented Jul 4, 2023

This is so that if MyPy is used in a charm, it type checks them. MyPy by default doesn't type check methods that have no type annotations on them. For example:

$ tox -e mypy
mypy: commands[0]> mypy
src/charm.py:49: error: Call to untyped function "remove_all_revisions" in typed context  [no-untyped-call]
Found 1 error in 1 file (checked 1 source file)

I forgot to do this in #953.

This is so that if MyPy is used in a charm, it type checks them. MyPy
by default doesn't type check methods that have no type annotations on
them.
@benhoyt
Copy link
Collaborator Author

benhoyt commented Jul 4, 2023

Just a couple of type annotation tweaks forgotten in #953 -- going to merge without further review, so I can go ahead with the release.

@benhoyt benhoyt merged commit 384ef3a into canonical:main Jul 4, 2023
19 checks passed
@benhoyt benhoyt deleted the mypy-return-none branch July 4, 2023 03:32
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.

1 participant