Reformatting docstrings and comments
See original GitHub issueBy running the current 0.10.0 version of yapf on
def func(a):
"""Do something awesome.
This is a long long long description of the awesome work that is done by this function. Despite being very detailed, it runs over the column limit.
"""
we basically cannot get any formatting of the docstring. Could you please help me if it is a feature that is currently absent from yapf? If it could be reformatted into something like,
def func(a):
"""Do something awesome.
This is a long long long description of the awesome work that is done by
this function. Despite being very detailed, it runs over the column limit.
"""
quite a lot of something like gq
in vim could be saved. If it could reformat the docstring in the default Sphinx, numpy, or Google format, probably it could be even more helpful.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:39
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Reformatting Python Multiline Comments and Docstrings in ...
I believe you are looking for the "textwrap" module, which controls denting, dedenting, paragraph width, etc.
Read more >The No 1 Ultimate Guide to Comments and Docstrings in Python
Firstly in Comment and Docstring Tutorial we are going to talk about Comments as they are more common and easier to understand.
Read more >Advanced Code Documentation Beyond Comments and ...
Personally, I prefer Google docstring format as it results in wider docstrings with fewer lines of code. Numpy docstring format tends to result...
Read more >Python Docstrings Tutorial : Examples & Format for Pydoc ...
Docstrings are represented with closing & opening quotes, while comments start with a # at the beginning. Note that comments can not be...
Read more >Docstrings Format — Python Notes for Linguistics
Docstrings Format ¶ · Docstrings are important in the coding process. · Good documentation of the codes would make the codes earsier to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I would also appreciate the option to have a different maximum line length for comments.
How about just piggybacking off of https://github.com/myint/docformatter? It just doesn’t seem inline with YAPF’s philosophy of being like go fmt in that a canonical formatting should be produced, when it totally ignores docstrings at the moment.