enabling pylint_django plugin in vscode, pylint stop working

前端 未结 5 1588
走了就别回头了
走了就别回头了 2021-02-12 11:49

That\'s my user settings in vscode

{
  \"python.pythonPath\": \"/Users/cristiano/miniconda3/envs/django-rest-2/bin/python\",
  \"python.linting.pylintEnabled\":          


        
5条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-12 12:03

    found a working answer for myself here: https://donjayamanne.github.io/pythonVSCodeDocs/docs/linting/

    my settings.json file now reads:

    {
        "python.pythonPath": "C:\\ProgramData\\Anaconda3\\envs\\djangoSite2\\python.exe",
        "python.linting.pylintEnabled": true,
        "python.linting.pylintArgs": ["--disable=C0111","--load-plugins", "pylint_django"],
    }
    

    this then adds linting, but doesn't throw an error on fields that it can't find (like the Entity.objects.all() one), but has the disadvantage that if you then try and reference something that really doesn't exist it doesn't throw an error.

提交回复
热议问题