I'm a big fan of pylint's built-in docstring checker. I'm very happy to require docstrings on all my classes, all my functions, and all my modules.
What I don't like, however, is that pylint also wants docstrings on all my test modules and all my pytest
test functions. This leads to low-value docstrings like the following:
"""Tests for foo.py"""
from foo import bar
def test_bar():
"""Tests for bar"""
assert bar(1) == 2
I've been able to disable the function-level docstring requirement using no-docstring-rgx
in my .pylintrc
file:
[MASTER]
no-docstring-rgx=^(_|test_)
This takes care of the missing-function-docstring
/ C0116
error.
But I haven't been able to find a way to disable the missing-module-docstring
/ C0114
error just for files ending with _test.py
. Is this possible with pylint?