pylint是一個用於檢查python代碼中的錯誤,嘗試強制執行編碼標準的工具。它還能夠查找某些類型錯誤,能夠建議如何重構特定塊的建議,並能夠向您提供有關代碼複雜性的詳細信息。html
官網:www.pylint.org/python
用戶手冊:https://pylint.readthedocs.io/en/latest/#note-for-windows-userswindows
在windows環境下須要在cmd命令行下執行工具
pip install pylint
pip命令在python安裝目錄中的Python\Python37\Scripts目錄下編碼
在 PyCharm 選擇 Settings> Plugins spa
搜索並安裝Pylint命令行
在 PyCharm 選擇 Settings>Pylintorm
選擇並配置pylint.exehtm
在窗口最下方會出現pylint窗口,使用綠色箭頭運行就能夠掃描文件。blog
這裏有一個技巧先使用Code > Reformate Code自動整理一下格式,而後再檢查會少不少問題。
若是不明白提示的含義能夠查看官方消息說明:http://pylint.pycqa.org/en/latest/technical_reference/features.html#basic-checker-messages