fmt on/off raises internal error when fmt: off in multi-level intended code block #2842
Labels
F: fmtoff
fmt: off implementation
R: duplicate
This issue or pull request already exists
T: bug
Something isn't working
Description
Black raises error when formatting code that includes specific combination of
fmt: off
andfmt: on
commands. The bug occurs whenfmt: off
is before intended block andfmt: on
inside intended block. Bug occurs only in multi-level indentation (see: examples below)To Reproduce
Try to format file with the code:
Note: similar code but with single-level of indent not raises any error:
And run it with these arguments:
The resulting error is:
Expected behavior
Black should format file without raising error.
Environment
The text was updated successfully, but these errors were encountered: