Open tjkuson opened 2 weeks ago
I don't know about this. I agree that it doesn't really make sense to enforce the usual set of docstring rules on, well, any test functions. But I'm not sure that I like the idea of special-casing specific third-party libraries for this kind of rule (even very popular libraries like pytest). My usual approach is just to set per-file-ignores
in my Ruff config so that all docstring-related rules are ignored for my test files.
That's a fair point. Ignoring the rule would be a solution, though there are some functions in test files over which I would still want to run pydoclint
checks (for example, complex mocks and utility functions).
That's a fair point. Ignoring the rule would be a solution, though there are some functions in test files over which I would still want to run pydoclint checks (for example, complex mocks and utility functions).
It sounds difficult for an automated tool to decide for which functions pydoclint
should run if only some functions should be checked. I guess my recommendation would be to move these utility functions to a different directory that still gets checked.
Running
ruff check --select DOC201 --preview --isolated
(Ruff version 0.6.2) onreports a docstring-missing-returns (DOC201) diagnostic.
The expected behaviour is that the return value of a function decorated with
pytest.fixture
is not expected to be documented, as such objects are not expected to be called by the user.Search terms: DOC201, docstring-missing-returns, pydoclint, pytest, fixture