【python】VS Code | pylint

I am doing Code Review recently, and the python plugin of vsCode uses a pylint tool by default to make a format specification for python code. But some formats do not want it to be prompted, so the following describes the configuration modification method of pylint in vsCode

1. Turn on/off/select linter

ctrl+shift+P to open (I don't know how to call it) the command line of vsCode? Enter Python: Enable Linting, and click to enable or disable pylint. Enter Python: Select Linter, click to select a different linter, the default is pylint

Two, configure linter

Menu bar: File-Preferences-Settings, search for pylintArgs directly, and configurable options will appear. According to the instructions on the official website of vsCode , you can modify it and turn off unnecessary reminders

1. Cancel the warning reminder about missing docstring/funcstring

--disable=missing-docstring
It should be that every class and function needs to have text explaining what it does. But adding a module docstring to every file that Django automatically generates when creating a new application is tedious and redundant. (Although I admit that some still need annotations, but I am lazy

2. Cancel the warning reminder about bad indentatin

disable=bad-indentation
The python specification requires a tab to be 4 spaces, because I don't want to explain why I have 2 spaces

3. Cancel the error reminder about Django was not configured

--disable=django-not-configured
This solution is rough, and I didn't understand the reason
stackoverflow question in detail

3. Python code specification

Python official document description: pep8

Guess you like

Origin blog.csdn.net/qq_42438771/article/details/120194626