Missing module docstring

OCTOBER 9, 2022

If pylint or other linter is giving you this error in a Python file, there's a simple way to get rid of it.

Missing module docstring pylint(missing-module-docstring)

Solving the error by adding a description

Simply add a description to the top of your Python file.

'''Description of your file.'''

# or

Description of your file.

Ignoring the error with .pylintrc

If you don't want to add a description, you can tell the linter to ignore this error by creating a .pylintrc file in your directory and adding the following code.

# .pylintrc
    C0114, # missing-module-docstring

You could ignore other errors the same way. Here's an exhaustive list of Pylint warning and error codes.

  • C0114 for missing-module-docstring
  • C0115 for missing-class-docstring
  • C0116 for missing-function-docstring

Ignoring the error with Visual Studio Code settings

Another way to ignore Pylint warnings and errors is to add the following configuration key to your VSCode settings.

# settings.json
"python.linting.pylintArgs": ["--disable=C0114"]