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

Update linters and adapt code for compatibility (SC-986) #1434

Merged
merged 4 commits into from
May 5, 2022

Conversation

paride
Copy link
Contributor

@paride paride commented May 5, 2022

Proposed Commit Message

Update linters and adapt code for compatibility

Changes:
- pylint 2.13.8: fix E0601(used-before-assignment)
- pylint 2.13.8: fix E4702(modified-iterating-dict)
- pylint 2.13.8: silence W0402(deprecated-module) on distutils.errors
- tox: bump linters versions

Additional Context

This should make the cloud-init-style-tip green.

Test Steps

tox -e py3,black,flake8,isort,mypy,pylint,tip-flake8,tip-mypy,tip-pylint

Checklist:

  • My code follows the process laid out in the documentation
  • I have updated or added any unit tests accordingly
  • I have updated or added any documentation accordingly

@paride paride changed the title Update linters and adapt code Update linters and adapt code for compatibility (SC-986) May 5, 2022
Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

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

One comment inline, but otherwise LGTM. There's a CI failure though.

@@ -209,6 +209,7 @@ def handle_hotplug(hotplug_init: Init, devpath, subsystem, udevaction):
success_fn=hotplug_init._write_to_cache,
) # type: UeventHandler
wait_times = [1, 3, 5, 10, 30]
last_exception = Exception("Bug while processing hotplug event.")
Copy link
Member

Choose a reason for hiding this comment

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

We already have a #type: ignore in the else clause for this particular issue. Lets either remove that hint with this change, or remove this change and add another linting hint.

@paride paride force-pushed the fix-tip-pylint branch from 9c97bd9 to 1812614 Compare May 5, 2022 14:14
Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

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

Thanks!

@TheRealFalcon TheRealFalcon merged commit dd494ed into canonical:main May 5, 2022
aciba90 pushed a commit to aciba90/cloud-init that referenced this pull request May 10, 2022
Changes:
- pylint 2.13.8: fix E0601(used-before-assignment)
- pylint 2.13.8: fix E4702(modified-iterating-dict)
- pylint 2.13.8: silence W0402(deprecated-module) on distutils.errors
- tox: bump linters versions
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.

2 participants