Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make star-expression spacing consistent in match/case #2667

Merged
merged 1 commit into from
Dec 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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)
Expand Down
2 changes: 2 additions & 0 deletions src/black/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@
syms.listmaker,
syms.testlist_gexp,
syms.testlist_star_expr,
syms.subject_expr,
syms.pattern,
}
TEST_DESCENDANTS: Final = {
syms.test,
Expand Down
5 changes: 5 additions & 0 deletions tests/data/pattern_matching_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,8 @@ def func(match: case, case: match) -> case:
match match:
case case:
pass


match a, *b(), c:
isidentical marked this conversation as resolved.
Show resolved Hide resolved
case d, *f, g:
pass