enhancement(typing): add type annotations to cloudinit.sources.helpers.netlink (#5445) - #7064
enhancement(typing): add type annotations to cloudinit.sources.helpers.netlink (#5445)#7064AhmadBilalDSA wants to merge 3 commits into
Conversation
blackboxsw
left a comment
There was a problem hiding this comment.
Thank your for this submission and helping improve quality in cloud-init.
I think there are a couple of thngs to resolve to move forward with this PR.
- Please avoid adding more
# type: ignorecomments to the code and actually resolve the typing issues in the file to progress toward proper typing coverage. - make
tox -e mypysucceed - update docstr
:returns:of create_bound_netlink_socket and get_netlink_msg_header to represent that actual instance type returned.
|
Thank you for the review, @blackboxsw! I have addressed all feedback points in the latest commit:
|
… remove unreachable check
|
All four feedback items have been addressed in
|
Addresses part of #5445 by adding strict type annotations to
cloudinit.sources.helpers.netlinkto satisfy--disallow-untyped-defs.Changes Made
cloudinit/sources/helpers/netlink.py.should_continue_cb).# type: ignore[attr-defined]guards for platform-specific socket attributes (AF_NETLINK,NETLINK_ROUTE).mypy --disallow-untyped-defs.Type of Change
Addresses #5445