I don't think people expect import sorting to fix bugs. It's just good (and free!) practice.
Anyway I have definitely had linters like Ruff catch bugs. Probably the most common is the mutable default argument gotcha.
Anyway I have definitely had linters like Ruff catch bugs. Probably the most common is the mutable default argument gotcha.
Also, mutable default argument is not a bug. It is a bug only if mutable default argument is mutated inside the body of a function/method. Which is almost never the case.
It's quite common in my experience.
And sure it's not always a bug, otherwise Python itself would flag it. The point of linters is to improve code quality to avoid things that are error-prone. This is one of the most error-prone things in Python in my experience.
First would probably be implicit bool coersion (e.g. `if a_string:`) but that can only be caught by a static type checker.