Skip to content

Commit fe1a85f

Browse files
authored
fix: update README example (#314)
The example in the README can't be produced because the 'Launch the rocket.' line gets picked up as a list is unformatted unlike in the example. For now the README will be updated until the list-like detection code is updated.
1 parent 1b576ae commit fe1a85f

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

README.rst

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,6 @@ this code
113113
This module docstring should be dedented."""
114114
115115
116-
def launch_rocket():
117-
"""Launch
118-
the
119-
rocket. Go colonize space."""
120-
121-
122116
def factorial(x):
123117
'''
124118
@@ -141,7 +135,7 @@ this code
141135
function"""
142136
print_factorial(5)
143137
if factorial(10):
144-
launch_rocket()
138+
print_factorial(22)
145139
146140
147141
gets formatted into this
@@ -153,14 +147,6 @@ gets formatted into this
153147
This module docstring should be dedented.
154148
"""
155149
156-
157-
def launch_rocket():
158-
"""Launch the rocket.
159-
160-
Go colonize space.
161-
"""
162-
163-
164150
def factorial(x):
165151
"""Return x factorial.
166152
@@ -179,7 +165,7 @@ gets formatted into this
179165
"""Main function."""
180166
print_factorial(5)
181167
if factorial(10):
182-
launch_rocket()
168+
print_factorial(22)
183169
184170
Marketing
185171
=========

src/docformatter/syntax.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@
180180
"""
181181

182182
HEURISTIC_MIN_LIST_ASPECT_RATIO = 0.4
183+
"""The minimum aspect ratio to consider a list."""
183184

184185

185186
def description_to_list(
@@ -649,7 +650,8 @@ def is_some_sort_of_list(
649650
"""
650651
split_lines = text.rstrip().splitlines()
651652

652-
# TODO: Find a better way of doing this.
653+
# TODO: Find a better way of doing this. Conversely, create a logger and log
654+
# potential lists for the user to decide if they are lists or not.
653655
# Very large number of lines but short columns probably means a list of
654656
# items.
655657
if (

0 commit comments

Comments
 (0)