-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
F: linetoolongBlack makes our lines too longBlack makes our lines too longT: bugSomething isn't workingSomething isn't working
Description
Describe the bug
Match patterns with lots of |-delimited alternatives are not split into multiple lines.
To Reproduce
% cat longmatch.py
match x:
case "abcd" | "abcd" | "abcd" | "abcd" | "abcd" | "abcd" | "abcd" | "abcd" | "abcd" | "abcd" | "abcd" | "abcd" | "abcd" | "abcd" | "abcd":
pass
% black -t py311 longmatch.py --diff
All done! ✨ 🍰 ✨
1 file would be left unchanged.(Note the line is 142 characters long)
Expected behavior
I want it to reformat to:
match x:
case (
"abcd"
| "abcd"
| "abcd"
| "abcd"
| "abcd"
| "abcd"
| "abcd"
| "abcd"
| "abcd"
| "abcd"
| "abcd"
| "abcd"
| "abcd"
| "abcd"
| "abcd"
):
passBlack does this already if you manually add parentheses around the whole sequence of alternatives.
Environment
- Black's version: 23.7.0
- OS and Python version: macOS
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
F: linetoolongBlack makes our lines too longBlack makes our lines too longT: bugSomething isn't workingSomething isn't working