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

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:

Make star-expression spacing consistent in match/case (#2667)
authorBatuhan Taskaya <isidentical@gmail.com>
Fri, 3 Dec 2021 14:49:33 +0000 (17:49 +0300)
committerGitHub <noreply@github.com>
Fri, 3 Dec 2021 14:49:33 +0000 (06:49 -0800)
CHANGES.md
src/black/nodes.py
tests/data/pattern_matching_extras.py

index fc198a8f8c0cd120adee3972ce15bf97283e395e..e5f4a1fdf82d13302978fad3f832e96a1aa93afe 100644 (file)
@@ -14,6 +14,7 @@
 - Fix `match`/`case` statements that contain `match`/`case` soft keywords multiple
   times, like `match re.match()` (#2661)
 - Fix `case` statements with an inline body (#2665)
 - Fix `match`/`case` statements that contain `match`/`case` soft keywords multiple
   times, like `match re.match()` (#2661)
 - Fix `case` statements with an inline body (#2665)
+- Fix styling of starred expressions inside `match` subject (#2667)
 - Fix assignment to environment variables in Jupyter Notebooks (#2642)
 - Add `flake8-simplify` and `flake8-comprehensions` plugins (#2653)
 - Fix determination of f-string expression spans (#2654)
 - Fix assignment to environment variables in Jupyter Notebooks (#2642)
 - Add `flake8-simplify` and `flake8-comprehensions` plugins (#2653)
 - Fix determination of f-string expression spans (#2654)
index 437051d3f6d5634910af587d2d4eec3cce574f8e..8bf1934bc2aec77fe33aea205c915bdeabb907e6 100644 (file)
@@ -97,6 +97,8 @@ UNPACKING_PARENTS: Final = {
     syms.listmaker,
     syms.testlist_gexp,
     syms.testlist_star_expr,
     syms.listmaker,
     syms.testlist_gexp,
     syms.testlist_star_expr,
+    syms.subject_expr,
+    syms.pattern,
 }
 TEST_DESCENDANTS: Final = {
     syms.test,
 }
 TEST_DESCENDANTS: Final = {
     syms.test,
index 095c1a2b3bb0fe9bbdab8f1a557c01b8401c4c82..60ad8a3d81b3a3d7468b42c627f2c9227319caee 100644 (file)
@@ -77,3 +77,8 @@ match match(
 match match:
     case case:
         pass
 match match:
     case case:
         pass
+
+
+match a, *b(), c:
+    case d, *f, g:
+        pass