-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Current problem
Currently, Pylint relies on isort as a mandatory dependency to handle wrong-import-position
and wrong-import-order
. However, maintaining and fixing isort-related issues consumes significant time and may not provide long-term value, given that:
- importing isort takes a not insignificant part of pylint's startup time
- if you use isort or ruff, pylint bring no value as it's autofixxed, and you simply disable those two checks
- it adds an additional layer of complexity with two or three noqas to handle (isort/pylint/ruff), especially considering that each of those noqas have scopes, and that by nature the scope of a noqa is blurry as disabling on the scope of a line will have implications on other lines because the checks are about ordering and other tools because ruff interact with isort already (see discussion)
Desired solution
There's two possible directions I can think of right now:
-
Drop isort and the wrong-import-position checker entirely, simplifying dependencies and improving startup performance.
-
Take a decision about how to handle the noqas. Add optional support for Ruff, using Ruff and isort as optional dependencies. This would allow future extensibility to autofix with ruff once the wrong-import-position proof of concept is validated (but we could still get this benefit without bothering with import order ourselves), so the main benefit is for users who use wrong-import-position and wrong-import-order.
Either approach implies a meaningful design change and likely belongs in Pylint 5.0.