Commit 7f29172
FIX Format string defaults correctly
Before this patch, string defaults are formatted without quotes around
them. However, if the default is a tuple or list of strings, quotes will
be included:
default="a" ==> :default: ``a``
default=("a",) ==> :default: ``('a')``
This is a slightly annoying inconsistency, and leads to potential for
confusion between `default="0"` and `default=0`. Most bothersome is that
in the case of an empty string we get:
:default: ````
Which makes docutils angry:
CRITICAL: Unexpected section title or transition.
This fixes the trouble by formatting the repr of the default.1 parent 34470b6 commit 7f29172
File tree
3 files changed
+26
-7
lines changed- releasenotes/notes
- sphinx_click
- tests
3 files changed
+26
-7
lines changedLines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
113 | | - | |
| 112 | + | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
| 251 | + | |
| 252 | + | |
251 | 253 | | |
252 | 254 | | |
253 | 255 | | |
| |||
273 | 275 | | |
274 | 276 | | |
275 | 277 | | |
276 | | - | |
| 278 | + | |
277 | 279 | | |
278 | 280 | | |
279 | 281 | | |
280 | 282 | | |
281 | 283 | | |
282 | 284 | | |
283 | 285 | | |
284 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
285 | 295 | | |
286 | 296 | | |
287 | 297 | | |
| |||
438 | 448 | | |
439 | 449 | | |
440 | 450 | | |
441 | | - | |
| 451 | + | |
442 | 452 | | |
443 | 453 | | |
444 | 454 | | |
| |||
0 commit comments