-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
It would be nice to retain the whitespace following lines even in multi-line expressions, such as list or dict definitions. Here is a (truncated) example where we are defining named fields in a binary format:
header_dtd = [
- ('sizeof_hdr', 'i4'), # 0; must be 348
- ('data_type', 'S10'), # 4; unused
- ('db_name', 'S18'), # 14; unused
- ('extents', 'i4'), # 32; unused
- ('session_error', 'i2'), # 36; unused
- ('regular', 'S1'), # 38; unused
- ('dim_info', 'u1'), # 39; MRI slice ordering code
- ('dim', 'i2', (8,)), # 40; data array dimensions
+ ('sizeof_hdr', 'i4'), # 0; must be 348
+ ('data_type', 'S10'), # 4; unused
+ ('db_name', 'S18'), # 14; unused
+ ('extents', 'i4'), # 32; unused
+ ('session_error', 'i2'), # 36; unused
+ ('regular', 'S1'), # 38; unused
+ ('dim_info', 'u1'), # 39; MRI slice ordering code
+ ('dim', 'i2', (8,)), # 40; data array dimensions
]
I realize this is going to be hard to get right 100% of the time, especially if other parts of the expression need to be shifted. I can just #fmt: off
it, but would there be any interest in handling this case?
Using: blue, version 0.9.0, based on black 22.1.0
droserasprout and dskrypa
Metadata
Metadata
Assignees
Labels
No labels