Pylint throws errors that some of files are missing docstrings. I try and add docstrings to each class, method and function but it seems that Pylint also checks that files s
Edit "C:\Users\Your User\AppData\Roaming\Code\User\settings.json" and add these python.linting.pylintArgs
lines at the end as shown below:
{
"team.showWelcomeMessage": false,
"python.dataScience.sendSelectionToInteractiveWindow": true,
"git.enableSmartCommit": true,
"powershell.codeFormatting.useCorrectCasing": true,
"files.autoSave": "onWindowChange",
"python.linting.pylintArgs": [
"--load-plugins=pylint_django",
"--errors-only"
],
}
It's late, but still I found it useful. So sharing. Found this here.
You can add "--errors-only" flag for pylint to disable warnings.
To do this, go to settings. Edit the following line:
"python.linting.pylintArgs": []
As
"python.linting.pylintArgs": ["--errors-only"]
And you are good to go!
In my case, with pylint 2.6.0, the missing docstring messages wouldn't disappear, even after explicitly disabling missing-module-docstring
, missing-class-docstring
and missing-function-docstring
in my .pylintrc
file. Finally, the following configuration worked for me:
[MESSAGES CONTROL]
disable=missing-docstring,empty-docstring
Apparently, pylint 2.6.0 still validates docstrings unless both checks are disabled.
With pylint 2.4 and above you can differentiate between the various missing-docstring
by using the three following sub-messages:
C0114
(missing-module-docstring
)C0115
(missing-class-docstring
)C0116
(missing-function-docstring
)So the following .pylintrc
file should work:
[MASTER]
disable=
C0114, # missing-module-docstring
I think the fix is relative easy without disabling this feature.
def kos_root():
"""Return the pathname of the KOS root directory."""
global _kos_root
if _kos_root: return _kos_root
All you need to do is add the triple double quotes string in every function.