Commit 475179a5 authored by Łukasz Langa's avatar Łukasz Langa
Browse files

Omit extra space in Sphinx auto-attribute comments

parent cf6f5779
Loading
Loading
Loading
Loading
+3 −0
Changes for README.md: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -324,6 +324,9 @@ More details can be found in [CONTRIBUTING](CONTRIBUTING.md).

* omit extra space in kwarg unpacking if it's the first argument (#46)

* omit extra space in [Sphinx auto-attribute comments](http://www.sphinx-doc.org/en/stable/ext/autodoc.html#directive-autoattribute)
  (#68)


### 18.3a3

+1 −1
Changes for black.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -1183,7 +1183,7 @@ def make_comment(content: str) -> str:

    if content[0] == '#':
        content = content[1:]
    if content and content[0] not in {' ', '!', '#'}:
    if content and content[0] not in ' !:#':
        content = ' ' + content
    return '#' + content

+20 −0
Changes for tests/comments.py: 20 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -49,6 +49,26 @@ def function(default=None):
# This time two lines.


class Foo:
    """Docstring for class Foo.  Example from Sphinx docs."""

    #: Doc comment for class attribute Foo.bar.
    #: It can have multiple lines.
    bar = 1

    flox = 1.5  #: Doc comment for Foo.flox. One line only.

    baz = 2
    """Docstring for class attribute Foo.baz."""

    def __init__(self):
        #: Doc comment for instance attribute qux.
        self.qux = 3

        self.spam = 4
        """Docstring for instance attribute spam."""


@fast(really=True)
async def wat():
    async with X.open_async() as x:  # Some more comments