Skip to content

Avoid marking required imports as unused#12537

Merged
charliermarsh merged 1 commit intomainfrom
charlie/required-import-remove
Jul 26, 2024
Merged

Avoid marking required imports as unused#12537
charliermarsh merged 1 commit intomainfrom
charlie/required-import-remove

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

Summary

If an import is marked as "required", we should never flag it as unused. In practice, this is rare, since required imports are typically used for __future__ annotations, which are always considered "used".

Closes #12458.

@charliermarsh charliermarsh added the bug Something isn't working label Jul 26, 2024
@charliermarsh charliermarsh changed the base branch from main to charlie/required-imports July 26, 2024 17:15
@charliermarsh charliermarsh force-pushed the charlie/required-import-remove branch from e6ea9f4 to b0bc967 Compare July 26, 2024 17:20
Base automatically changed from charlie/required-imports to main July 26, 2024 17:35
@charliermarsh charliermarsh force-pushed the charlie/required-import-remove branch from b0bc967 to 7546721 Compare July 26, 2024 17:36
@github-actions
Copy link
Copy Markdown
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@charliermarsh charliermarsh merged commit e18c45c into main Jul 26, 2024
@charliermarsh charliermarsh deleted the charlie/required-import-remove branch July 26, 2024 18:23
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.

[Infinite loop] Parser error with I002 (required imports) and F401 (unused import)

1 participant