ruff icon indicating copy to clipboard operation
ruff copied to clipboard

`D102` - Don't enforce docstrings on `__new__` and `__call__`

Open DetachHead opened this issue 2 years ago • 3 comments

re-raising https://github.com/PyCQA/pydocstyle/issues/515 here:

This should be considered a magic method (controlled by D105), or at least have a different error code (which may be D107 together with __init__ or even a new one).

DetachHead avatar Oct 20 '23 02:10 DetachHead

pycodestyle doesn't complain about a __new__ method without a docstring. Ruff should be consistent and not consider __new__ an ordinary public method that requires a dosctring.

pya avatar Mar 30 '24 14:03 pya

@pya Apologies if it's just a typo but I think the plugin which is being referenced here is pydocstyle ("doc") and not pycodestyle ("code"). pycodestyle doesn't have rules around docstring convention.

dhruvmanila avatar Apr 01 '24 08:04 dhruvmanila

@dhruvmanila Thanks for the hint. Mixed up "code" and "doc".

pya avatar Apr 02 '24 12:04 pya