File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 44
55import logging
66import itertools
7+ import re
78
89from docstrfmt .docstrfmt import Manager , IgnoreMessagesReporter , pairwise
910from docstrfmt .main import Reporter
@@ -136,7 +137,11 @@ def visit_Documentation(self, node):
136137
137138 manager = StyleManager (current_file = self .robot_file )
138139
139- doc_node = manager .parse_string (doc_string , line_offset = node .lineno - 1 ) # , file=self.robot_file
140+ # Ensure bullet lists are preceded by a blank line
141+ text = re .sub (r'([^\n])\n([-*+]) ' , r'\1\n\n\2 ' , doc_string )
142+
143+ doc_node = manager .parse_string (text , line_offset = node .lineno - 1 )
144+ doc_node .settings .tab_width = 4
140145 formatted_doc = manager .format_node (self .line_length , doc_node ).rstrip ()
141146 if manager .error_count > 0 :
142147 self .issues_found = True
You can’t perform that action at this time.
0 commit comments