Skip to content

Fix '# fmt' directives.

They were not aligned properly, which causes Black to crash:

$ black --version
black, version 20.8b1

$ cat test.py
def f():
    # fmt: off
    if True:
        print()
        # fmt: on

def g():
    pass

$ black test.py
error: cannot format test.py: INTERNAL ERROR: Black produced code that is not equivalent to the source.  Please report a bug on https://github.com/psf/black/issues.  This diff might be helpful: /tmp/blk_phpp_27o.log
Oh no! 💥 💔 💥
1 file failed to reformat.

https://github.com/psf/black/issues/569


Migrated from D4784 (view on Phabricator)

Merge request reports