Skip to content

Commit 44a1944

Browse files
author
PX4BuildBot
committed
Fix up summary error reporting
1 parent c6a3261 commit 44a1944

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Tools/msg/generate_msg_docs.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ def parseFile(self):
331331
# Or perhaps we just fix it on request
332332

333333
if not found_first_relevant_content and not stripped_line:
334+
#print(f"DEBUG: found_first_relevant_content (false): comment line: {stripped_line}")
334335
continue
335336
if not found_first_relevant_content and stripped_line:
336337
found_first_relevant_content = True
@@ -343,7 +344,7 @@ def parseFile(self):
343344

344345
if gettingInitialComments and stripped_line.startswith("#"):
345346
stripped_line=stripped_line[1:].strip()
346-
#print(f"comment line: {stripped_line}")
347+
#print(f"DEBUG: gettingInitialComments: comment line: {stripped_line}")
347348
initial_block_lines.append(stripped_line)
348349
else:
349350
gettingInitialComments = False
@@ -400,7 +401,7 @@ def camel_to_snake(name):
400401
error = Error("topic_error", self.filename, "", f"NOTE: TOPIC - Default topic {defaultTopic} for {self.name} not in {self.topics}")
401402

402403
# Parse our short and long description
403-
#print(f"TODO: initial_block_lines: {initial_block_lines}")
404+
#print(f"DEBUG: initial_block_lines: {initial_block_lines}")
404405
doingLongDescription = False
405406
for summaryline in initial_block_lines:
406407
if not self.shortDescription and summaryline.strip() == '':
@@ -414,15 +415,16 @@ def camel_to_snake(name):
414415
if doingLongDescription:
415416
self.longDescription += f"{summaryline}\n"
416417

417-
else:
418+
if self.longDescription:
419+
self.longDescription.strip()
420+
421+
if not self.shortDescription:
418422
# Summary has not been defined
419423
error = Error("summary_missing", self.filename)
420424
if not "summary_missing" in self.errors:
421425
self.errors["summary_missing"] = []
422426
self.errors["summary_missing"].append(error)
423427

424-
if self.longDescription:
425-
self.longDescription.strip()
426428

427429
# TODO Parse our enumvalues into enums, leaving only constants
428430
enumValuesToRemove = []

0 commit comments

Comments
 (0)