Skip to content

Commit

Permalink
Merge pull request #2 from juftin/main
Browse files Browse the repository at this point in the history
cleanup description
  • Loading branch information
tlambert03 authored Dec 17, 2023
2 parents a346c30 + c4d49fd commit dd4072b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/griffe_fieldz/_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import annotations

import inspect
import textwrap
from operator import ge
from typing import TYPE_CHECKING, Any, Iterable, Sequence

Expand Down Expand Up @@ -119,10 +120,11 @@ def _fields_to_params(
params: list[DocstringParameter] = []
attrs: list[DocstringAttribute] = []
for field in fields:
description = field.description or field.metadata.get("description", "")
kwargs: dict = {
"name": field.name,
"annotation": _to_annotation(field.type, docstring),
"description": field.description or field.metadata.get("description", ""),
"description": textwrap.dedent(description).strip(),
"value": _default_repr(field),
}
if field.init:
Expand Down

0 comments on commit dd4072b

Please sign in to comment.