Open dscorbett opened 6 days ago
I'm wondering if, unlike the previous infinite-loop fix, this should be fixed by giving an error directly on the user's configuration? Especially in the case where the user has entered in both the required import and the required alias.
I'm wondering if, unlike the previous infinite-loop fix, this should be fixed by giving an error directly on the user's configuration? Especially in the case where the user has entered in both the required import and the required alias.
Yes, that makes sense to me! These two configuration options just flatly contradict each other in this case, I think.
unconventional-import-alias
(ICN001) conflicts withmissing-required-import
(I002) in Ruff 0.7.4 whenunused-import
(F401) is also enabled, if an import is required without a conventional alias but is unused. ICN001’s fix should be skipped for required imports, even if the required imports lack conventional aliases. It would still be helpful for ICN001 to report a violation without a fix.In that example, I002 inserts
import pandas
, ICN001 changes it toimport pandas as pd
, I002 insertsimport pandas
again, F401 removes the unusedimport pandas as pd
, and then back to ICN001 and so on.