]> 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:

Improve docstring re-indentation handling
authorŁukasz Langa <lukasz@langa.pl>
Tue, 25 Aug 2020 20:26:13 +0000 (22:26 +0200)
committerŁukasz Langa <lukasz@langa.pl>
Tue, 25 Aug 2020 21:14:39 +0000 (23:14 +0200)
commit9270a10f6f59f069eb14ffba0c75f58e5895b27c
treee3d737ff9cde98c10b532b87a76d78556f7cc7ff
parent586d24236e6b57bc3b5da85fdbe2563835021076
Improve docstring re-indentation handling

This addresses a few crashers, namely:

* producing non-equivalent code due to mangling escaped newlines,

* invalid hugging quote characters in the docstring body to the docstring outer
  triple quotes (causing a quadruple quote which is a syntax error),

* lack of handling for docstrings that start on the same line as the `def`, and

* invalid stripping of outer triple quotes when the docstring contained
  a string prefix.

As a bonus, tests now also run when string normalization is disabled.
src/black/__init__.py
tests/data/docstring.py
tests/test_black.py