Describe the bug
Parsing a multiline case statement with # fmt: skip fails with black >= 26.
To Reproduce
For example, take this code:
# file.py
match (method, *path.split("/")):
case ("GET", "parent", _, "resource", resource_id) \
| ("GET", "resource", resource_id): # fmt: skip
pass
case _:
pass
And run it with these arguments:
The resulting error is:
error: cannot format file.py: Cannot parse: 6:42: | ("GET", "resource", resource_id): # fmt: skip
Expected behavior
The multi-line case statement remains unchanged.
Environment
- Black's version: 26.1.0 and up (no issue with 25.12.0).
- OS and Python version: [Windows/Python 3.13.2] -->
Describe the bug
Parsing a multiline
casestatement with# fmt: skipfails with black >= 26.To Reproduce
For example, take this code:
And run it with these arguments:
The resulting error is:
Expected behavior
The multi-line
casestatement remains unchanged.Environment