How do you fix "Missing module docstringpylint(missing-module-docstring)"

I'm using the pygame module on VS Code and I ran into the issue where the pygame has not init member. I followed the solutions to this link. I edited the user settings and added

"python.linting.pylintArgs": [ "--extension-pkg-whitelist=pygame", "--unsafe-load-any-extension=y"
]

to the end of the json file

The pygame problem was resolved. However, when I use import random. I get this warning:

Missing module docstringpylint(missing-module-docstring)

How do I make it go away? Also, is there a better way to resolve the init problem of pygame?

1

5 Answers

A python module's docstring documents what the contents of that file are for.

You can solve this error by adding a docstring at the top of the module:

"""
Provides some arithmetic functions
"""
def add(a, b): """Add two numbers""" return a + b
def mult(a, b): """Multiply two numbers""" return a * b

Read more at

I just figured out what docstrings are. They just describe the function or class. It's enclosed in three double quotation marks or single quotation marks. This helped me.

To remove docstring warnings in VSCode, I just added "--disable=C0111" to "python.linting.pylintArgs": [], which was in the User's JSON settings.

1

I added the settings below in VsCode to disable all the docstring warnings.

"python.linting.pylintArgs": [ "--disable=missing-module-docstring", "--disable=missing-class-docstring", "--disable=missing-function-docstring"
]
1

This Answer is updated with the docs of the extension add below code in vscode's settings.json

"pylint.args": [ "--disable=missing-module-docstring", "--disable=missing-class-docstring", "--disable=missing-function-docstring"
],

this will disable the warnings for module, class and function docstring

ref: extension's docs

This error is coming out when we are using pylint in the directory that doesn't have .pylintrc. Go to directory which has .pylintrc and run from there.

Example:

test/ test1.py test2/test2.py .pylintrc

If you want to run pylint for test2.py inside test/test2 then you will get that error.

test/test2$ pylint test2.py is wrong.
test$ pylint test2.py is correct.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like