在vscode中启用pylint_django插件,pylint停止工作 [英] enabling pylint_django plugin in vscode, pylint stop working
问题描述
这是我在vscode中的用户设置
That's my user settings in vscode
{
"python.pythonPath": "/Users/cristiano/miniconda3/envs/django-rest-2/bin/python",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.linting.pylintArgs": [
"--load-plugins",
"pylint_django"
],
}
我通过conda安装了插件,与pylint相同
I installed the plugin via conda, same as the pylint
pylint 2.1.1 py36_0
pylint-django 0.11.1 py_1 conda-forge
pylint-plugin-utils 0.4 py_0 conda-forge
如果我注释掉了"python.linting.pylintArgs"部分,则pylint可以正常工作.我已启用该插件来避免特定于Django的错误,例如"Entity.objects.all()",但如果启用它,棉绒将停止工作:它不会突出显示标准错误,也不会警告以前的操作.
If i commented out the "python.linting.pylintArgs" section, pylint works with no problem. I ned to enable the plugin to avoid django-specific errros such as "Entity.objects.all()", but if I enable it, the lint stop working: it does not highlight standard errors o warning the previously was doing it.
在Win和Mac上使用vscode时,我的行为完全相同.我也尝试按照此处所述使用.pylintrc文件,但结果相同:皮棉停止工作.使用基本conda env或自定义环境的行为相同.
I have same exact behaviour using vscode for win and mac. I tried also to use the .pylintrc file as described here but I have the same result: lint stop working. Same behaviour using base conda env or a custom one.
推荐答案
此 pylint
的配置对我有用:
"python.linting.pylintEnabled": true,
"python.linting.pylintArgs": [
"--disable=C0111", // missing docstring
"--load-plugins=pylint_django,pylint_celery",
],
这篇关于在vscode中启用pylint_django插件,pylint停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!