Skip to content

Commit

Permalink
update-dbus-docs: don't consider mentions in the History
Browse files Browse the repository at this point in the history
Being mentioned in the History section as added in a specific version isn't
enough to consider a member documented.
  • Loading branch information
abderrahim committed Sep 19, 2023
1 parent d9d2d16 commit d0c0c10
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tools/update-dbus-docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,16 @@ def print_interface(iface, *, prefix, file, print_boring, only_interface, declar
print(f'''{prefix}}};''', file=file)

def document_has_elem_with_text(document, elem, item_repr):
predicate = f".//{elem}" # [text() = 'foo'] doesn't seem supported :(
predicate = f".//{elem}[. = '{item_repr}']"

# Ignore mentions in the History section
history = document.find(".//refsect1[title = 'History']")
history_mentions = history.findall(predicate) if history else []

for loc in document.findall(predicate):
if loc.text == item_repr:
return True
if loc in history_mentions:
continue
return True
return False

def check_documented(document, declarations, stats):
Expand Down

0 comments on commit d0c0c10

Please sign in to comment.