Skip to content

[pep8-naming] Don't flag from imports following conventional import names (N817)#12946

Merged
MichaReiser merged 3 commits intomainfrom
fix-n817-from-import
Aug 17, 2024
Merged

[pep8-naming] Don't flag from imports following conventional import names (N817)#12946
MichaReiser merged 3 commits intomainfrom
fix-n817-from-import

Conversation

@MichaReiser
Copy link
Copy Markdown
Member

Summary

Fixes #12940

#12922 changes N817 to not flag imports that follow an import convention.
I missed to handle from .. import imports as part of this PR. This PR implements the same logic for from .. import imports.

Test Plan

Added test

@MichaReiser MichaReiser added the bug Something isn't working label Aug 17, 2024
Comment thread crates/ruff_linter/resources/test/fixtures/pep8_naming/N817.py Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 17, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@MichaReiser MichaReiser enabled auto-merge (squash) August 17, 2024 11:53
@MichaReiser MichaReiser merged commit 96802d6 into main Aug 17, 2024
@MichaReiser MichaReiser deleted the fix-n817-from-import branch August 17, 2024 12:05
@darosio
Copy link
Copy Markdown

darosio commented Aug 21, 2024

Could you please confirm that this fix is working also for jupyter (.ipynb) files?
Thank you.

@dhruvmanila
Copy link
Copy Markdown
Member

@darosio I think this should work for Jupyter notebooks as well. Is there an issue that you're facing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

N817 not correctly detecting from xml.etree import ElementTree as ET

4 participants