Pylint not running as expected in VScode

后端 未结 2 1739
时光取名叫无心
时光取名叫无心 2021-02-13 20:13

When I am running via shell a pylint:

$ pylint decorator.py 
No config file found, using default configuration
************* Module decorator
C:  7,         


        
相关标签:
2条回答
  • 2021-02-13 20:51

    Assuming you have configured Python's Extension correctly and you have Pylint installed,

    VSCode's Python Extension will do minimal checking by default if you do not provide a Pylint configuration option.

    Simply enter "python.linting.pylintUseMinimalCheckers": false, into your .vscode/settings.json to force this off.

    This is how mine looks:

    {
        "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,
    }
    

    0 讨论(0)
  • 2021-02-13 20:56

    I had a similar problem where flake8 worked in VSCode but pylint didn't. Here are all the steps I had to check for pylint to start working:

    1. Your .vscode\settings.json file enables linting by pylint (this can be hand edited or by running these command palette commands: Python: Enable Linting and Python: Select Linter)

      "python.linting.enabled": true

      "python.linting.pylintEnabled": true

    2. from the command line (while in virtual environment) confirming that pylint and pylint-django are installed.

      pip show pylint

      pip show pylint-django

    3. Add a .pylintrc file to your root directory that includes these lines.

      [MASTER]

      load-plugins=pylint_django

    (NOTE: you can replace this pylintrc file with the following line in settings.json.)

    "python.linting.pylintArgs": ["--load-plugins", "pylint_django"]
    

    For more info about using pylint in VSCode, see https://code.visualstudio.com/docs/python/linting#_pylint

    For more info about the pylintrc file, see https://docs.pylint.org/en/1.6.0/run.html#command-line-options

    0 讨论(0)
提交回复
热议问题