Skip to content

Commit

Permalink
chore: Sentence case for comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Jan 14, 2024
1 parent 3cf7958 commit 206d338
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/griffe/agents/inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,19 @@ def __init__(

def _get_docstring(self, node: ObjectNode) -> Docstring | None:
try:
# access `__doc__` directly to avoid taking the `__doc__` attribute from a parent class
# Access `__doc__` directly to avoid taking the `__doc__` attribute from a parent class.
value = getattr(node.obj, "__doc__", None)
except Exception: # noqa: BLE001 # getattr can trigger exceptions
return None
if value is None:
return None
try:
# we avoid `inspect.getdoc` to avoid getting
# We avoid `inspect.getdoc` to avoid getting
# the `__doc__` attribute from a parent class,
# but we still want to clean the doc
# but we still want to clean the doc.
cleaned = cleandoc(value)
except AttributeError:
# triggered on method descriptors
# Triggered on method descriptors.
return None
return Docstring(
cleaned,
Expand Down

0 comments on commit 206d338

Please sign in to comment.