reflex icon indicating copy to clipboard operation
reflex copied to clipboard

Replace darglint with ruff DOC rules.

Open Lendemor opened this issue 1 year ago β€’ 3 comments

Darglint is not maintained anymore, and is very slow.

Alternative to covers the docstring checks:

  • pydoclint: Is actively maintained and the rules mostly make sense, but they are not selectable, so it's all or nothing.
  • ruff DOC rules: These rules are inspired by pydoclint but will give us the flexibility of ruff in selecting the rules we want to apply.
    • need to track the progress on this issue before we can use this however: https://github.com/astral-sh/ruff/issues/12434

Subset of the rules we need enabled in ruff, before we can remove darglint:

  • [ ] DOC101
  • [ ] DOC102
  • [ ] DOC103
  • [ ] DOC104
  • [ ] DOC111
  • [x] DOC201
  • [x] DOC202
  • [x] DOC402
  • [x] DOC403
  • [x] DOC501
  • [x] DOC502

Lendemor avatar Nov 29 '24 12:11 Lendemor

Hi @Lendemor , I'm the author of pydoclint. If you use pydoclint in the flake8 mode, you can select which violations you want to include or exclude.

Using pydoclint in the flake8 mode is almost as fast as using it in the native mode.

jsh9 avatar Jan 12 '25 07:01 jsh9

Hi @jsh9 I gave it a try and it seems to work fine.

Ultimately we'd still want to have those rules enabled in ruff because it make the config easier / reduce the number of tools used.

But for now it seems usable so maybe we will give it a try.

Lendemor avatar Jan 22 '25 17:01 Lendemor