Black formatter – Ignore specific multi-line code

You can use #fmt: on/off as explained in the issue linked. In your case it would look like:

# fmt: off
np.array(
    [
        [1, 0, 0, 0],
        [0, -1, 0, 0],
        [0, 0, 1, 0],
        [0, 0, 0, -1],
    ]
)
# fmt: on

# fmt: off disables formatting for all following lines until formatting is activated again with # fmt: on

Leave a Comment

error code: 521