程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python code checking tool + encapsulated in pychar extension tool

編輯:Python
  1. Flake8( Static code detection tool ) It's the encapsulation of the following three tools :

    1. PyFlakes: Static check Python Tools for code logic errors .

    2. Pep8: Static check PEP8 Coding style tools .

    3. NedBatchelder’s McCabe script: Static analysis Python Tools for code complexity .

  2. mypy yes Python Optional static type checker for , You can find errors in the program when you do not run the program

  3. isort Can make import The imported package is more beautiful

  4. 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.


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved