doxy: deal with empty method comments
authordberzano <dario.berzano@cern.ch>
Tue, 9 Dec 2014 19:14:17 +0000 (20:14 +0100)
committerdberzano <dario.berzano@cern.ch>
Fri, 9 Jan 2015 15:01:08 +0000 (16:01 +0100)
doxygen/thtml2doxy.py

index 3c51e8b..cd3f7f8 100755 (executable)
@@ -198,11 +198,19 @@ def comment_method(cursor, comments):
 
     if emit_comment:
 
-      comment = refactor_comment( comment )
+      if comment_line_start > 0:
 
-      if len(comment) > 0:
-        logging.debug("Comment found for function %s" % Colt(comment_function).magenta())
-        comments.append( Comment(comment, comment_line_start, comment_col_start, comment_line_end, comment_col_end, comment_indent, comment_function) )
+        comment = refactor_comment( comment )
+
+        if len(comment) > 0:
+          logging.debug("Comment found for function %s" % Colt(comment_function).magenta())
+          comments.append( Comment(comment, comment_line_start, comment_col_start, comment_line_end, comment_col_end, comment_indent, comment_function) )
+        else:
+          logging.debug('Empty comment for function %s marked for removal' % Colt(comment_function).magenta())
+          comments.append(RemoveComment(comment_line_start, comment_line_end))
+
+      else:
+        logging.warning('No comment found for function %s' % Colt(comment_function).magenta())
 
       comment = []
       comment_line_start = -1