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

Fix a crash in preview style with assert + parenthesized string. (#3415)
authorYilei "Dolee" Yang <yileiyang@google.com>
Sat, 10 Dec 2022 15:58:45 +0000 (07:58 -0800)
committerGitHub <noreply@github.com>
Sat, 10 Dec 2022 15:58:45 +0000 (07:58 -0800)
commit96e62c57e3023977de177a8ba34678007a63f1fe
tree971be70be1aca2e0bf335689da6fefe5341d42e7
parent1f7f6de4aba4e1e42cb2f947204f8256f7370cb0
Fix a crash in preview style with assert + parenthesized string. (#3415)

The bug is in the `get_leaves_inside_matching_brackets` on the third line below:

```python
assert xxxxxxxxx.xxxxxxxxx.xxxxxxxxx(
    xxxxxxxxx
).xxxxxxxxxxxxxxxxxx(), (
    "xxx {xxxxxxxxx} xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
)
```

Including the invisible paren, third line is `).xxxxxxxxxxxxxxxxxx()), (`, that it has a matched pair then an unmatched closing paren afterwards. This PR ensures the returned leaves are actually matched.

Fixes #3414.
CHANGES.md
src/black/brackets.py
tests/data/preview/trailing_commas_in_leading_parts.py