ruff
8095ff0e - enforce required imports even with useless alias (#14287)

Commit
1 year ago
enforce required imports even with useless alias (#14287) This PR handles a panic that occurs when applying unsafe fixes if a user inserts a required import (I002) that has a "useless alias" in it, like `import numpy as numpy`, and also selects PLC0414 (useless-import-alias) In this case, the fixes alternate between adding the required import statement, then removing the alias, until the recursion limit is reached. See linked issue for an example. Closes #14283 --------- Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
Author
Parents
Loading