]> git.madduck.net Git - etc/vim.git/commit

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Actually disable docstring prefix normalization with -S + fix instability (#3168)
authorRichard Si <63936253+ichard26@users.noreply.github.com>
Thu, 14 Jul 2022 23:47:33 +0000 (19:47 -0400)
committerGitHub <noreply@github.com>
Thu, 14 Jul 2022 23:47:33 +0000 (19:47 -0400)
commitad5c315ddad26a3c41f22d3b73c493fb7d7b86b8
tree3aa28dfd5e108d27bd7b220c9fe2126a9211785b
parent9aa33f467bafce081635ce88807d42b10b0a3105
Actually disable docstring prefix normalization with -S + fix instability (#3168)

The former was a regression I introduced a long time ago. To avoid
changing the stable style too much, the regression is only fixed if
--preview is enabled

Annoyingly enough, as we currently always enforce a second format pass if
changes were made, there's no good way to prove the existence of the
docstring quote normalization instability issue. For posterity, here's
one failing example:

    --- source
    +++ first pass
    @@ -1,7 +1,7 @@
     def some_function(self):
    -    ''''<text here>
    +    """ '<text here>

         <text here, since without another non-empty line black is stable>

    -    '''
    +    """
         pass
    --- first pass
    +++ second pass
    @@ -1,7 +1,7 @@
     def some_function(self):
    -    """ '<text here>
    +    """'<text here>

         <text here, since without another non-empty line black is stable>

         """
         pass

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
CHANGES.md
src/black/linegen.py
src/black/mode.py
tests/data/miscellaneous/docstring_preview_no_string_normalization.py [new file with mode: 0644]
tests/data/simple_cases/docstring.py
tests/test_format.py