Skip to content

Commit cf03e85

Browse files
committed
Fix for docstrings on source files
`doxy_dict` attribute created in wrong place
1 parent 045a17b commit cf03e85

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

ford/sourceform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ def __init__(
259259
):
260260
self.name = "unknown"
261261
self.visible = False
262-
self.doxy_dict: Dict[str, str] = {}
263262
self.permission = inherited_permission.lower()
264263
self.strings: List[str] = strings or []
265264

@@ -820,6 +819,7 @@ def __init__(
820819
self.VARIABLE_RE = re.compile(
821820
self.VARIABLE_STRING.format(typestr), re.IGNORECASE
822821
)
822+
self.doxy_dict: Dict[str, str] = {}
823823

824824
# This is a little bit confusing, because `permission` here is sort of
825825
# overloaded for "permission for this entity", and "permission for child

test/test_sourceform.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2375,3 +2375,13 @@ def test_doxygen_multiple_metadata(parse_fortran_file):
23752375
assert module.meta.author == "Foo Shamaloo"
23762376
assert module.meta.version == "3.14"
23772377
assert module.doc_list == [" Main details"]
2378+
2379+
2380+
def test_doxygen_ok_on_source_file(parse_fortran_file):
2381+
data = """\
2382+
!! @brief Source file
2383+
module a
2384+
end module a
2385+
"""
2386+
fortran_file = parse_fortran_file(data)
2387+
assert fortran_file.meta.summary == "Source file"

0 commit comments

Comments
 (0)