Wetts's blog

Stay Hungry, Stay Foolish.

0%

VSCode中pylint插件

修改对 django 项目中的错误语法提示

  1. 安装 pylint-django 的 Python 包
  2. 在 settings.json 中添加如下配置
    1
    2
    3
    4
    "python.linting.pylintArgs": [
    "--load-plugins",
    "pylint_django"
    ],

1

原因是

1
It is nice for a Python module to have a docstring, explaining what the module does, what it provides, examples of how to use the classes. This is different from the comments that you often see at the beginning of a file giving the copyright and license information, which IMO should not go in the docstring (some even argue that they should disappear altogether, see eg.

2

原因是

1
2
3
As your code is not contained in a class or function it is expecting those variables to be constants and as such they should be uppercase.

You can read PEP8 for further information.