Pylint работает не так, как ожидалось в VScode - PullRequest
1 голос
/ 17 апреля 2019

Когда я запускаю через оболочку pylint:

$ pylint decorator.py 
No config file found, using default configuration
************* Module decorator
C:  7, 0: Unnecessary parens after 'print' keyword (superfluous-parens)
C: 15, 0: Unnecessary parens after 'print' keyword (superfluous-parens)
C:  1, 0: Missing module docstring (missing-docstring)
C:  4, 0: Missing function docstring (missing-docstring)
C:  6, 4: Missing function docstring (missing-docstring)
C: 14, 0: Missing function docstring (missing-docstring)

Однако, как видно ниже, эти предупреждения не появляются в VSCode

enter image description here

... несмотря на то, что некоторая базовая проверка действительно выполняется, как показано на следующем рисунке, где я удалил пустую строку:

enter image description here

1 Ответ

3 голосов
/ 17 апреля 2019

Если вы правильно настроили расширение Python и у вас установлен Pylint,

Расширение VSCode Python выполнит минимальную проверку по умолчанию , если вы не укажете опцию конфигурации Pylint.

Просто введите "python.linting.pylintUseMinimalCheckers": false, в .vscode/settings.json, чтобы отключить это.

Вот так выглядит моя:

{
    "autoDocstring.docstringFormat": "numpy",
    "editor.minimap.enabled": false,
    "editor.selectionClipboard": false,
    "python.pythonPath": "/home/jim/anaconda3/envs/dipoleDisplay",
    "window.zoomLevel": 0,
    "terminal.integrated.rendererType": "dom",
    "python.linting.pylintUseMinimalCheckers": false,
}

after setting

...