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

codestyle: Type annotate various modules and add them to mypy #1237

Merged

Conversation

stefanberger
Copy link
Contributor

This PR type-annotates various modules and adds them to mypy.

@THS-on THS-on added the cleanup label Dec 5, 2022
@stefanberger stefanberger force-pushed the stefanberger/annotate_various_ad_mypy branch from 4c6ace3 to f9c7fef Compare December 5, 2022 17:34
@codecov-commenter
Copy link

Codecov Report

Merging #1237 (4c6ace3) into master (1d01309) will decrease coverage by 0.03%.
The diff coverage is 96.00%.

❗ Current head 4c6ace3 differs from pull request most recent head f9c7fef. Consider uploading reports for the commit f9c7fef to get more accurate results

Additional details and impacted files
Flag Coverage Δ
packit-e2e 71.32% <96.00%> (-0.04%) ⬇️
testsuite 58.75% <96.00%> (ø)
unittests 14.05% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
keylime/ca_util.py 68.07% <91.66%> (+0.18%) ⬆️
keylime/ca_impl_openssl.py 98.63% <100.00%> (+0.01%) ⬆️
keylime/cert_utils.py 80.45% <100.00%> (+0.22%) ⬆️
keylime/fs_util.py 100.00% <100.00%> (ø)
keylime/revocation_notifier.py 61.63% <100.00%> (ø)
keylime/tpm_ek_ca.py 81.81% <100.00%> (+0.86%) ⬆️
keylime/types.py 100.00% <100.00%> (ø)
keylime/registrar_common.py 57.75% <0.00%> (-0.87%) ⬇️
keylime/crypto.py 89.56% <0.00%> (ø)
keylime/common/migrations.py

@stefanberger stefanberger force-pushed the stefanberger/annotate_various_ad_mypy branch from f9c7fef to 22ce83f Compare December 5, 2022 17:48
@stefanberger stefanberger force-pushed the stefanberger/annotate_various_ad_mypy branch from 22ce83f to 9222f81 Compare December 5, 2022 18:22
Type-annotate ca_util.py and also minimally annotate
revocation_notifier.py so ca_util.py passed mypy checks.

Signed-off-by: Stefan Berger <[email protected]>
@stefanberger stefanberger force-pushed the stefanberger/annotate_various_ad_mypy branch from 9222f81 to f65039f Compare December 5, 2022 23:08
@@ -498,7 +511,7 @@ def read_private(warn=False):
return {"revoked_keys": [], "ca": b""}, base64.b64encode(crypto.generate_random_key()).decode()


def main(argv=sys.argv): # pylint: disable=dangerous-default-value
def main(argv: List[str] = sys.argv) -> None: # pylint: disable=dangerous-default-value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah this disable should be a TODO. This is very dangerous indeed.

@stefanberger stefanberger force-pushed the stefanberger/annotate_various_ad_mypy branch from 4dbaa9b to 0ac97b3 Compare December 6, 2022 13:32
@THS-on THS-on merged commit 3033371 into keylime:master Dec 6, 2022
@stefanberger stefanberger deleted the stefanberger/annotate_various_ad_mypy branch December 6, 2022 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants