【问题标题】:Pylint not finding errors in vscodePylint 在 vscode 中没有发现错误
【发布时间】:2018-04-12 11:42:29
【问题描述】:

我已将 vscode 配置为使用 pylint。

工作区设置:

"python.pythonPath": "/home/name/python-venv/machine learning/bin/python3",
"python.linting.pylintPath": "/home/name/python-venv/machine-learning/bin/pylint",

路径链接到虚拟 python 环境。 当我从命令提示符 (ctrl+P) 运行 Python: Run Linting 时,输出中的输出 -> Python 窗口为:

##########Linting Output - pylint##########
No config file found, using default configuration

-------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 2.31/10, +7.69)

即使它应该发现文件有任何问题,它也不会发现任何问题。 当我从终端(有或没有活动的虚拟环境)运行此命令时,我得到以下输出:

No config file found, using default configuration
************* Module test
C:  1, 0: Missing module docstring (missing-docstring)
C:  2, 0: Constant name "hello" doesn't conform to UPPER_CASE naming 
style (invalid-name)
C:  3, 0: Constant name "sess" doesn't conform to UPPER_CASE naming 
style (invalid-name)

-------------------------------------------------------------------
Your code has been rated at 2.50/10 (previous run: 10.00/10, -7.50)

谁能告诉我它的行为是这样的吗?

【问题讨论】:

    标签: python visual-studio-code pylint


    【解决方案1】:

    通过使用手动生成 pylintrc 解决了这个问题

    pylint --generate-rcfile > ~/.pylintrc
    

    现在一切正常

    【讨论】:

      猜你喜欢
      • 2018-01-01
      • 2019-09-25
      • 1970-01-01
      • 2018-12-08
      • 1970-01-01
      • 2019-11-09
      • 2021-12-28
      • 1970-01-01
      • 2015-09-03
      相关资源
      最近更新 更多