Open mflova opened 10 months ago
The problem here is that import_failed
is not reported at a particular line, because it doesn't happen while pyanalyze is visiting the file, but while it's trying to import it. If this error happens, it will essentially make it impossible for pyanalyze to check the rest of the file. I'm not sure that's something I should change, as it's an essential part of pyanalyze that it works by importing the file.
Your last example works because # static analysis: ignore
on a line by itself at the beginning of the file ignores the entire file.
It makes sense. I do not think it is worth to change it then. Thanks for the feedback!
So far I found this strange behaviour when trying to silence some
import_failed
error codes. Here is a minimal example: