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

I'm using the pygame module on VSCode 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?

Thanks!



Solution 1:[1]

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 https://www.python.org/dev/peps/pep-0257/#multi-line-docstrings

Solution 2:[2]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Benny Powers
Solution 2 Jalil Nourmohammadi Khiarak