Skip to content

Add type annotations to functions in hostname.py - #6964

Open
XEDAB wants to merge 3 commits into
canonical:mainfrom
XEDAB:main
Open

Add type annotations to functions in hostname.py#6964
XEDAB wants to merge 3 commits into
canonical:mainfrom
XEDAB:main

Conversation

@XEDAB

@XEDAB XEDAB commented Jul 30, 2026

Copy link
Copy Markdown

Add type annotations (parameter types and return types) to all functions in hostname.py, so a reader can tell at a glance what each function expects and returns.

@blackboxsw

Copy link
Copy Markdown
Collaborator

Thank you for this contribution, To aid the majority of readers in this repository, could you please ensure the proposed commit message and summary is in English.

@blackboxsw blackboxsw added the incomplete Action required by submitter label Jul 30, 2026
@XEDAB

XEDAB commented Jul 31, 2026

Copy link
Copy Markdown
Author

Sorry, will fix the commit message and PR title to English.

@XEDAB XEDAB changed the title 为 distros/parsers/hostname.py 中的函数添加了类型注释 Add type annotations to functions in hostname.py Jul 31, 2026
@XEDAB

XEDAB commented Aug 2, 2026

Copy link
Copy Markdown
Author

PR description updated to English.

@holmanb

holmanb commented Aug 10, 2026

Copy link
Copy Markdown
Member

Please sign the CLA. Also, please don't forget to remove this module from mypy's ignore list in pyproject.toml. It also looks like there are failing unit tests and lint tests. Please review the contribution guide: https://docs.cloud-init.io/en/latest/development/index.html

@holmanb holmanb self-assigned this Aug 10, 2026
str | None needs Python 3.10+. Optional[str] is the 3.9-safe
equivalent. Also remove hostname.py from the mypy ignore list now
that it carries full annotations.
@holmanb holmanb added the CLA not signed The submitter of the PR has not (yet) signed the CLA label Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA not signed The submitter of the PR has not (yet) signed the CLA incomplete Action required by submitter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants