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

add conventional xml.etree.ElementTree import alias #12455

Merged
merged 3 commits into from
Aug 12, 2024

Conversation

edhinard
Copy link
Contributor

Summary

Adding a conventional alias for ElementTree. I looked for other conventional aliases in standard library in order to generalize the point, but found none.
There is still an issue with this. It conflicts with N817 CamelCase 'ElementTree' imported as acronym 'ET'. I have to ignore locally:
import xml.etree.ElementTree as ET # noqa: N817
too bad

Test Plan

only test as a lint.flake8-import-conventions.extend-aliases configuration option

@charliermarsh
Copy link
Member

You need to add this to CONVENTIONAL_ALIASES in crates/ruff_linter/src/rules/flake8_import_conventions/settings.rs too. We may need to include this in the next minor version.

@charliermarsh charliermarsh added this to the v0.6 milestone Jul 25, 2024
@charliermarsh charliermarsh added the configuration Related to settings and configuration label Jul 25, 2024
Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

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

Thanks. I think this is reasonable to include but it'll have to wait until the next minor version.

@MichaReiser MichaReiser added the breaking Breaking API change label Jul 26, 2024
@MichaReiser MichaReiser changed the base branch from main to ruff-0.6 August 12, 2024 09:22
@MichaReiser MichaReiser merged commit a0bb459 into astral-sh:ruff-0.6 Aug 12, 2024
20 checks passed
@MichaReiser MichaReiser mentioned this pull request Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking API change configuration Related to settings and configuration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants