Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Isn't flake8 meant to validate find import errors (E0401)?

Standard installation of flake8. Version 3.5.0. Running with:

flake8 /<module directory>

It lists unused imports but not incorrect imports (an import that doesn't exist). I couldn't find anything in the documentation whether that is intended or not. Can someone clarify?

pylint finds incorrect imports and reports them as E0401.

like image 258
kev Avatar asked Nov 16 '25 11:11

kev


1 Answers

the default set of flake8 plugins perform static checks -- that is they analyze your source code in isolation. they do not run your code, they do not follow imports, they do not see much beyond the source, tokenization, and ast of your program

other things such as pylint, mypy, etc. perform dynamic analysis, that is they analyze your codebase as a whole. they're going to need to do a lot more work to perform that analysis and as such they're going to be slower


disclaimer: I'm the current flake8 maintainer, I also maintain the default plugins pycodestyle, pyflakes, and mccabe

like image 154
Anthony Sottile Avatar answered Nov 18 '25 21:11

Anthony Sottile