-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
34470b6
commit 7f29172
Showing
3 changed files
with
26 additions
and
7 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
releasenotes/notes/better-string-defaults-3664ae102b044972.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
features: | ||
- | | ||
Now when the default value of an option is a string it will be rendered with | ||
quotes around it. | ||
fixes: | ||
- | | ||
If an option has an empty string default, docutils will no longer emit | ||
warnings saying ``CRITICAL: Unexpected section title or transition.`` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters