class SampleClass:
"""Summary of class here.
Longer class information....
Longer class information....
Attributes:
likes_spam: A boolean indicating if we really really really really really like SPAM or not.
eggs: An integer count of the eggs we have laid. Repeat, An integer count of the eggs we have laid.
"""
def __init__(self, likes_spam: bool = False):
"""Inits SampleClass with blah."""
self.likes_spam = likes_spam
self.eggs = 0
The current behavior of Rewrap v1.14.0 on VS code is the expected behavior of "rewrap.concatenateMultiLineParagraph": true. Python code after rewrapping the long docstring:
class SampleClass:
"""Summary of class here.
Longer class information.... Longer class information....
Attributes: likes_spam: A boolean indicating if we really really really
really really like SPAM or not. eggs: An integer count of the eggs we
have laid. Repeat, An integer count of the eggs we have laid.
"""
def __init__(self, likes_spam: bool = False):
"""Inits SampleClass with blah."""
self.likes_spam = likes_spam
self.eggs = 0
The expected behavior of "rewrap.concatenateMultiLineParagraph": false. Python code after rewrapping the long docstring:
class SampleClass:
"""Summary of class here.
Longer class information....
Longer class information....
Attributes:
likes_spam: A boolean indicating if we really really really really
really like SPAM or not.
eggs: An integer count of the eggs we have laid. Repeat, An integer
count of the eggs we have laid.
"""
def __init__(self, likes_spam: bool = False):
"""Inits SampleClass with blah."""
self.likes_spam = likes_spam
self.eggs = 0
Is it possible to add a setting to disable multi-line paragraph concatenation. Say the setting is
"rewrap.concatenateMultiLineParagraph"
.Python code with long docstring before rewrap (adapted from https://google.github.io/styleguide/pyguide.html#384-classes):
The current behavior of Rewrap
v1.14.0
on VS code is the expected behavior of"rewrap.concatenateMultiLineParagraph": true
. Python code after rewrapping the long docstring:The expected behavior of
"rewrap.concatenateMultiLineParagraph": false
. Python code after rewrapping the long docstring:Related to https://github.com/stkb/Rewrap/issues/89.
https://github.com/google/yapf does not format docstrings or comments https://github.com/google/yapf/issues/279. Although the comments suggest using https://github.com/myint/docformatter, Python VS code extension decides not to support multiple document formatters at once https://github.com/microsoft/vscode-python/issues/1324.