当前位置:   article > 正文

PyCharm使用技巧:Inspect Code(代码静态审查)_pycharm inspect code

pycharm inspect code

        PyCharm的Inspect Code提供了代码静态审查功能,可以检测出语法错误,不符合PEP8的代码以及提供建议,方便集中这类问题。

示例代码:

  1. author = "dgw"
  2. def test_func():
  3. res = '666'
  4. return res
  5. def test_func2():
  6. res2 = '666'
  7. def inner_func():
  8. return 666
  9. return res2
  10. class Test(object):
  11. def __init__(self, name, age):
  12. self.name = name
  13. self.age = age
  14. def run(self):
  15. return 666
  16. print(dir(Test))

Inspect Code使用:

Inspect Code界面包括两部分:左边列出审查结果,右边操作界面。

点击右边的Reformat file 按钮可以自动格式化代码使之符合PEP8规范。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/829406
推荐阅读
相关标签
  

闽ICP备14008679号