You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix: excessive whitespace in middle of line
* test: fix failing tests
* fix: space after field with no description
* fix: wrapping reST section admonitions
* doc: documentation for new argument
* fix: not wrapping fields at proper wrap length
* test: fix failing tests
* fix: not considering field name in wrap length
* fix: adding space in :meth: role with no link
* fix: sphinx style wrapping fields with parentheses
* fix: no summary description treated like summary
* docs: update documentation
* fix: adding blank space when no field body
* chore: update version string for release
---------
Signed-off-by: Doyle Rowland <[email protected]>
Copy file name to clipboardExpand all lines: docs/source/requirements.rst
+21-12Lines changed: 21 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,8 +57,7 @@ Docstring Style
57
57
There are at least four "flavors" of docstrings in common use today;
58
58
Epytext, Sphinx, NumPy, and Google. Each of these docstring flavors follow the
59
59
PEP 257 *convention* requirements. What differs between the three docstring
60
-
flavors is the reST syntax used in the parameter description of the multi-line
61
-
docstring.
60
+
flavors is the reST syntax used in the field list of the multi-line docstring.
62
61
63
62
For example, here is how each syntax documents function arguments.
64
63
@@ -97,11 +96,10 @@ syntactical directives so they can be placed properly in the structure of the
97
96
docstring. To accommodate the various syntax flavors used in docstrings, a
98
97
third requirement category is introduced, *style*.
99
98
100
-
Another consideration in for the *style* category is line wrapping.
101
-
According to PEP 257, splitting a one-line docstring is to allow "Emacs’
102
-
``fill-paragraph`` command" to be used. The ``fill-paragraph`` command is a
103
-
line-wrapping command. Additionally, it would be desirable to wrap
104
-
docstrings for visual continuity with the code.
99
+
Another consideration in the *style* category is line wrapping. According to PEP
100
+
257, splitting a one-line docstring is to allow "Emacs’ ``fill-paragraph`` command"
101
+
to be used. The ``fill-paragraph`` command is a line-wrapping command. Additionally,
102
+
it would be desirable to wrap docstrings for visual continuity with the code.
105
103
106
104
NumPy makes a stylistic decision to place a blank line after the long
107
105
description.
@@ -141,7 +139,7 @@ The following items are exceptions or interpretations of the PEP 257
141
139
requirements:
142
140
143
141
* One-line and summary lines can end with any punctuation. ``docformatter`` will recognize any of [. ! ?]. Exception to requirement PEP_257_4.5; consistent with Google style. See also #56 for situations when this is not desired.
144
-
* One-line and summary lines will have the first word capitalized. ``docformatter`` will capitalize the first word for grammatical correctness. Interpretation of requirement PEP_257_4.5.
142
+
* One-line and summary lines will have the first word capitalized. ``docformatter`` will capitalize the first word for grammatical correctness. Interpretation of requirement PEP_257_4.5. Some proper nouns are explicitly spelled using a lowercase letter (e.g., ``docformatter``). A user option is provided for a list of words to maintain lower case.
145
143
* PEP 257 discusses placing closing quotes on a new line in the multi-line section. However, it really makes no sense here as there is no way this condition could be met for a multi-line docstring. Given the basis provided in PEP 257, this requirement really applies to wrapped one-liners. Thus, this is assumed to apply to wrapped one-liners and the closing quotes will be placed on a line by themselves in this case. However, an argument will be provided to allow the user to select their desired behavior. Interpretation of requirement PEP_257_5.5.
146
144
147
145
These give rise to the *derived* requirement category which would also cover
@@ -208,22 +206,28 @@ the requirement falls in, the type of requirement, and whether
208
206
' docformatter_10.1.3.1', ' Shall maintain in-line links on one line even if the resulting line exceeds wrap length.', ' Derived', ' Shall', ' Yes [*PR #152*]'
209
207
' docformatter_10.1.3.2', ' Shall not place a newline between description text and a wrapped link.', ' Derived', ' Shall', ' Yes [PR #182]'
210
208
' docformatter_10.2', ' Should format docstrings using NumPy style.', ' Style', ' Should', ' No'
211
-
' docformatter_10.2.1', ' Shall ignore docstrings in other styles when using NumPy style.', ' Shall', ' Yes'
209
+
' docformatter_10.2.1', ' Shall ignore docstrings in other styles when using NumPy style.', ' Style', ' Shall', ' Yes'
212
210
' docformatter_10.2.2', ' Shall wrap NumPy-style parameter descriptions that exceed wrap length when using NumPy style.', ' Shall', ' No'
213
211
' docformatter_10.3', ' Should format docstrings using Google style.', ' Style', ' Should', ' No'
214
-
' docformatter_10.3.1', ' Shall ignore docstrings in other styles when using Google style.', ' Shall', ' Yes'
212
+
' docformatter_10.3.1', ' Shall ignore docstrings in other styles when using Google style.', ' Style', ' Shall', ' Yes'
215
213
' docformatter_10.3.2', ' Shall wrap Google-style parameter descriptions that exceed wrap length when using Google style.', ' Shall', ' No'
216
214
' docformatter_10.4', ' Should format docstrings using Sphinx style.', ' Style', ' Should', ' Yes'
217
-
' docformatter_10.4.1', ' Shall ignore docstrings in other styles when using Sphinx style.', ' Shall', ' Yes'
215
+
' docformatter_10.4.1', ' Shall ignore docstrings in other styles when using Sphinx style.', ' Style', ' Shall', ' Yes'
218
216
' docformatter_10.4.2', ' Shall wrap Sphinx-style parameter descriptions that exceed wrap length when using Sphinx style.', ' Shall', ' Yes'
217
+
' docformatter_10.4.3', ' Shall ensure one blank space between a field name and field body.', ' Style', ' Shall', ' Yes [PR #220]'
218
+
' docformatter_10.4.3.1', ' Shall NOT add a blank space after a field name when the field body is a link.', ' Style', ' Shall', ' Yes [PR #220]'
219
+
' docformatter_10.4.3.2', ' Shall NOT add a blank space after a field name when there is no field body.', ' Style', ' Shall', ' Yes [PR #220]'
219
220
' docformatter_10.5', ' Should format docstrings compatible with black.', ' Style', ' Should', ' Yes [PR #192]'
220
221
' docformatter_10.5.1', ' Should wrap summaries at 88 characters by default in black mode.', ' Style', ' Should', ' Yes'
221
222
' docformatter_10.5.2', ' Should wrap descriptions at 88 characters by default in black mode.', ' Style', ' Should', ' Yes'
222
223
' docformatter_10.5.3', ' Should insert a space before the first word in the summary if that word is quoted when in black mode.', ' Style', ' Should', ' Yes'
223
224
' docformatter_10.5.4', ' Default black mode options should be over-rideable by passing arguments or using configuration files.', ' Style', ' Should', ' Yes'
224
225
' docformatter_10.6', ' Should format docstrings using Epytext style.', ' Style', ' Should', ' Yes'
225
-
' docformatter_10.6.1', ' Shall ignore docstrings in other styles when using Epytext style.', ' Shall', ' Yes'
226
+
' docformatter_10.6.1', ' Shall ignore docstrings in other styles when using Epytext style.', ' Style', ' Shall', ' Yes'
226
227
' docformatter_10.6.2', ' Shall wrap Epytext-style parameter descriptions that exceed wrap length when using Epytext style.', ' Shall', ' Yes'
228
+
' docformatter_10.7', ' Should format docstrings using ReStructured Text (reST) directives.', ' Style', ' Should', ' No'
229
+
' docformatter_10.7.1', ' Shall NOT wrap section headers or their adornments.', ' Style', 'Shall', ' Yes [PR #220]'
0 commit comments