Skip to content

chore(nocloud): enable untyped function checks - #7075

Open
dwaradwara wants to merge 1 commit into
canonical:mainfrom
dwaradwara:fix-nocloud-typing
Open

chore(nocloud): enable untyped function checks#7075
dwaradwara wants to merge 1 commit into
canonical:mainfrom
dwaradwara:fix-nocloud-typing

Conversation

@dwaradwara

Copy link
Copy Markdown

Proposed Commit Message

chore(nocloud): enable untyped function checks

Add typing needed for strict function-body checking and remove the
NoCloud check_untyped_defs exemption.

Refs GH-5445

Additional Context

Enable strict function-body type checking for DataSourceNoCloud.

This adds the type information required by mypy, removes
DataSourceNoCloud from the check_untyped_defs exemption, and annotates
the shared DataSource _platform_type attribute to match its existing
string-or-None behavior.

No intended runtime behavior changes.

Test Steps

tox -e mypy -- cloudinit/sources/DataSourceNoCloud.py
tox -e py3 -- tests/unittests/sources/test_nocloud.py
tox -e ruff -- cloudinit/sources/DataSourceNoCloud.py cloudinit/sources/__init__.py
tox -e black -- cloudinit/sources/DataSourceNoCloud.py cloudinit/sources/__init__.py
tox -e isort -- cloudinit/sources/DataSourceNoCloud.py cloudinit/sources/__init__.py
git diff --check

NoCloud unit tests: 19 passed.

Merge type

  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits.

Add typing needed for strict function-body checking and remove the NoCloud check_untyped_defs exemption.

Refs canonicalGH-5445
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