Skip to content

Config error only when flake8-import-conventions alias conflicts with isort.required-imports bound name#15918

Merged
dylwil3 merged 4 commits intoastral-sh:mainfrom
dylwil3:alias-config
Feb 4, 2025
Merged

Config error only when flake8-import-conventions alias conflicts with isort.required-imports bound name#15918
dylwil3 merged 4 commits intoastral-sh:mainfrom
dylwil3:alias-config

Conversation

@dylwil3
Copy link
Collaborator

@dylwil3 dylwil3 commented Feb 3, 2025

Previously an error was emitted any time the configuration required both an import of a module and an alias for that module. However, required imports could themselves contain an alias, which may or may not agree with the required alias.

To wit: requiring import pandas as pd does not conflict with the flake8-import-conventions.alias config {"pandas":"pd"}.

This PR refines the check before throwing an error.

Closes #15911

@dylwil3 dylwil3 added bug Something isn't working configuration Related to settings and configuration labels Feb 3, 2025
@dylwil3 dylwil3 requested a review from ntBre February 3, 2025 23:28
@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Contributor

@ntBre ntBre left a comment

Choose a reason for hiding this comment

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

Looks great, thank you for fixing this!

@dylwil3 dylwil3 merged commit 700e969 into astral-sh:main Feb 4, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working configuration Related to settings and configuration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Import alias settings of I002 and ICN001 conflict even when they agree

2 participants