Skip to content

Commit

Permalink
Fix ignoring undocumented instance attributes
Browse files Browse the repository at this point in the history
Fixes #451
  • Loading branch information
AWhetter committed Jun 22, 2024
1 parent 2172f92 commit fbacc72
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion autoapi/_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def parse_functiondef(self, node):
for child in node.get_children():
if isinstance(child, (astroid.nodes.Assign, astroid.nodes.AnnAssign)):
child_data = self._parse_assign(child)
result.extend(data for data in child_data if data["doc"])
result.extend(data for data in child_data)

return result

Expand Down
1 change: 1 addition & 0 deletions docs/changes/451.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix ignoring undocumented instance attributes
1 change: 1 addition & 0 deletions tests/python/test_pyintegration.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def check_integration(self, parse, example_path):
assert foo.find(id="example.Foo.Meta")

# Check that class attributes are documented
assert foo.find(id="example.Foo.attr")
attr2 = foo.find(id="example.Foo.attr2")
assert "attr2" in attr2.text
# Check that attribute docstrings are used
Expand Down

0 comments on commit fbacc72

Please sign in to comment.