astral-sh / astral-sh/ruff

Implement rules in `darglint`

Open
#458 47 comments 98 reactions 0 assignees View on GitHub
docstring plugin
Dominant language
Rust
Stars
49.6k
Forks
2.4k
Avg merge
2d 1h
Merged PRs (30d)
445

Description

This might be superseded by https://github.com/astral-sh/ruff/issues/12434

---

https://pypi.org/project/darglint/

> Darglint's primary focus is to identify incorrect and missing documentationd
of a function's signature. Checking style is a stretch goal, and is supported
on a best-effort basis. Darglint does not check stylistic preferences expressed
by tools in the Python Code Quality Authority (through tools such as pydocstyle).
So when using Darglint, it may be a good idea to also use pydocstyle, if you
want to enforce style. (For example, pydocstyle requires the short summary
to be separated from other sections by a line break. Darglint makes no such check.)

Error Codes


  • DAR001: The docstring was not parsed correctly due to a syntax error.

  • DAR002: An argument/exception lacks a description

  • DAR003: A line is under-indented or over-indented.

  • DAR004: The docstring contains an extra newline where it shouldn't.

  • DAR005: The item contains a type section (parentheses), but no type.

  • DAR101: The docstring is missing a parameter in the definition.

  • DAR102: The docstring contains a parameter not in function.

  • DAR103: The docstring parameter type doesn't match function.

  • DAR104: (disabled) The docstring parameter has no type specified

  • DAR105: The docstring parameter type is malformed.

  • DAR201: The docstring is missing a return from definition.

  • DAR202: The docstring has a return not in definition.

  • DAR203: The docstring parameter type doesn't match function.

  • DAR301: The docstring is missing a yield present in definition.

  • DAR302: The docstring has a yield not in definition.

  • DAR401: The docstring is missing an exception raised.

  • DAR402: The docstring describes an exception not explicitly raised.

  • DAR501: The docstring describes a variable which is not defined.

Contributor guide

Open the contributing guide

Research direction

First check whether Ruff issue #12434 supersedes this work, then review darglint's documented error-code list. If it remains in scope, identify the corresponding Ruff rule entry points and tests before defining completion; the payload names no files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.