Open Grub4K opened 8 months ago
Thanks for the clear write-up!
I would rather go with adding this as a separate rule. @charliermarsh Is this why you marked this with "rule" label?
Why a separate rule if it's the same idea?
cc @AlexWaygood
Is this why you marked this with "rule" label?
(No, the "rule" label can represent either a new rule or a change to an existing rule.)
Why a separate rule if it's the same idea?
This might be a stretch but it could lead to name collisions. So, we could either have "stdlib" as a possible value or maybe provide a new config option for that rule (banned-from-stdlib = true
).
I'm curious why the stdlib would be special in terms of "potentially clashing naming causing confusion." What about other third-party libraries? Should the option here really be banned-from-non-first-party
?
Maybe banned-from-non-first-party
could have "stdlib"
as a sentinel to signify only stdlib for that case? Having it as a boolean option alone could mean not having enough granular control over what to ban?
Our project decided to no longer allow stdlib imports with
from
due to potentially clashing naming causing confusion. We are currently resorting to including every stdlib in theflake8-import-conventions
banned-from
setting:However this is very cumbersome. Is there a possiblity of referencing all stdlib modules? A shortcut like this could perhaps also be used for different importing settings.
I've searched for
ICN003
,banned-from
andbanned-import-from
, but could not find anything related.