pylint doesn't point to virtualenv python

后端 未结 10 1736
执笔经年
执笔经年 2021-01-07 19:19

I am pretty new to python and currenty I am trying to use pylint for checking code quality. I am getting a problem. My pylint doesn\'t point to virtualenv python interpreter

10条回答
  •  时光说笑
    2021-01-07 19:29

    Ran into the same problem just today. Continuing on ThorSummoner's answer, when using Pylint with pylint-django inside of a virtual environment such as Pipenv, make sure to call pylint using the target python interpreter (python -m pylint)

    A good approach, which will work locally and on your CI as well is to write-down the lint command in the script section of your Pipfile:

    [scripts]
    lint = "python -m pylint [--options] all-my-modules-names..."
    

    Then calling pylint is as easy as :

    pipenv run lint
    

提交回复
热议问题