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 e.g. Get Rid of Source Code Templates)
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
For previous versions of Pylint, it does not have a separate code for the various place where docstrings can occur, so all you can do is disable C0111. The problem is that if you disable this at module scope, then it will be disabled everywhere in the module (i.e., you won't get any C line for missing function / class / method docstring. Which arguably is not nice.
So I suggest adding that small missing docstring, saying something like:
"""
high level support for doing this and that.
"""
Soon enough, you'll be finding useful things to put in there, such as providing examples of how to use the various classes / functions of the module which do not necessarily belong to the individual docstrings of the classes / functions (such as how these interact, or something like a quick start guide).
Answer from gurney alex on Stack OverflowWhat does missing module docstring mean? I do not want to disable pylint I just want to know
Missing docstring error when linting ?
[lint] missing-module-docstring example.py
W0511: Doesn't detect TODO in docstrings
Videos
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 e.g. Get Rid of Source Code Templates)
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
For previous versions of Pylint, it does not have a separate code for the various place where docstrings can occur, so all you can do is disable C0111. The problem is that if you disable this at module scope, then it will be disabled everywhere in the module (i.e., you won't get any C line for missing function / class / method docstring. Which arguably is not nice.
So I suggest adding that small missing docstring, saying something like:
"""
high level support for doing this and that.
"""
Soon enough, you'll be finding useful things to put in there, such as providing examples of how to use the various classes / functions of the module which do not necessarily belong to the individual docstrings of the classes / functions (such as how these interact, or something like a quick start guide).
As mentioned by followben in the comments, a better solution is to just disable the rules that we want to disable rather than using --errors-only. This can be done with --disable=<msg ids>, -d <msg ids>.
The list of message IDs can be found here. For the specific error mentioned in the question, the message ID is C0111.
For using --disable= param in your choise of IDE or Text Editor, you will need to figure out how to do it.
For VS Code, this can be done by adding this in settings.json:
"python.linting.pylintArgs": ["--disable=C0111"]
I have a comment in the first line of my code but pylint is firing me the following error; Missing module docstringpylint(missing-docstring) How do I resolve this error ?
When I write just a small print statement that says
print("Hi!")in visual studio code, and execute it using ./program.py it shows syntax error that says
./program.py: line 1: syntax error near unexpected token `"Hi!"'
./program.py: line 1: `print("Hi!")'and when I hover over the print statement it says
[pylint] C0111:Missing module docstring
I have installed the recommended python extension from microsoft. Python version is 3.6.3. I can execute python statements in terminal easily but can't seem to execute a .py file. I searched but couldn't find a fix for this. Any help would be appreciated.