numerique-gouv / people

Teams management application
MIT License
13 stars 1 forks source link

Add linter rule for missing docstrings #491

Closed Morendil closed 3 weeks ago

Morendil commented 1 month ago

Purpose

Fixes #104

Proposal

Add D1 (pydocstyle rule set related to missing docstrings) only for the time being. This requires fixing 73 missing docstrings. The full set or pydocstyle rules requires 413 fixes, comprising mostly whitespace and punctuation issues.

We exclude D106 (missing docstring in nested class) owing to heavy use of Meta nested classes in Django. See https://github.com/PyCQA/pydocstyle/pull/261

We exclude D105 (missing docstring in magic method) as it picks up a number of __str__ methods, which are not high-value docstring targets, the docstring tends to be a restatement of what the single line of code does.

This brings down the total to about 30 missing docstrings, which is reasonable for a single PR.