Pylint在vscode中找不到错误

Odd*_*Odd 3 python pylint visual-studio-code

我已经将vscode配置为使用pylint。

工作区设置:

"python.pythonPath": "/home/name/python-venv/machine learning/bin/python3",
"python.linting.pylintPath": "/home/name/python-venv/machine-learning/bin/pylint",
Run Code Online (Sandbox Code Playgroud)

路径链接到虚拟python环境。当我运行Python时:从命令提示符(ctrl + P)运行Linting,输出结果为int输出-> 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)
Run Code Online (Sandbox Code Playgroud)

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

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)
Run Code Online (Sandbox Code Playgroud)

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

Odd*_*Odd 9

通过使用以下命令手动生成pylintrc来解决此问题

pylint --generate-rcfile > ~/.pylintrc
Run Code Online (Sandbox Code Playgroud)

现在一切正常