Skip to content

missing-public-module-documentation (PDF602)

Added in 1.0.0 Never fix By default

Part of the PDF rule category.

View source · View documentation source · Search issues

Fix is not available.

What it does

Checks for public modules that are missing a module docstring.

Package initializers are handled by the package rules instead. A module path is public when no discovered module or package path component starts with an underscore.

Why is this useful?

Public modules should describe their purpose and exported surface.

Ruff compatibility

This rule replaces Ruff's D100.

Examples

A public module without a module docstring is reported:

VALUE = 1
PDF602: Line 1: Public module is missing docstring

A documented public module is accepted:

"""Session management."""

VALUE = 1

Package initializers are ignored by the module rule:

VALUE = 1

Private module paths are handled by PDF603 instead:

VALUE = 1

Options

None.