Flake8( Static code detection tool ) It's the encapsulation of the following three tools :
PyFlakes: Static check Python Tools for code logic errors .
Pep8: Static check PEP8 Coding style tools .
NedBatchelder’s McCabe script: Static analysis Python Tools for code complexity .
mypy yes Python Optional static type checker for , You can find errors in the program when you do not run the program
isort Can make import The imported package is more beautiful
black It detects code styles that do not conform to the specification and formats them directly , You don't need to be sure , Make decisions for you directly
Because it is usually used black most , Here, only black Installation , The same goes for the rest .
Step1:pip install black
Step2: open Pycharm Set up , Search for External tools
Step3: Select... In the dialog box + Number ( Here's the key )
Just configure it Program and Arguments
Program Words , You need to install black Environment configuration
Paraments Words , To configure -m black $FilePath$ that will do
OK that will do
Testing
All done!
1 file left unchanged.