darglint icon indicating copy to clipboard operation
darglint copied to clipboard

Optionally test for missing docstrings

Open krischer opened this issue 6 years ago • 0 comments

It is pretty useful to be able to enforce that docstrings exist. This PR adds a new CLI flag --raise-on-missing-docstrings that, as the name implies, raises errors if docstrings for public functions or methods do not exist.

Support has also been added to the config object and files.

The error codes

  • I002: Missing docstring for public method.
  • I003: Missing docstring for public function.

are inspired by the pydocstyle errors: https://github.com/PyCQA/pydocstyle/blob/cc5a96b356e2f10e8c95f1ca719efa3380237671/src/pydocstyle/violations.py#L171

The I1XX group has already been taken so I used the I0XX group.

I'm not sure if you'd like to guard this behind the --raise-on-missing-docstrings flag as it is currently implemented or just use it by default.

krischer avatar Jul 24 '19 11:07 krischer