Cannot format when unaligned # fmt: on
follows function body
#1175
Labels
T: bug
Something isn't working
# fmt: on
follows function body
#1175
Describe the bug
Black cannot reformat a file when:
# fmt: on
directive# fmt: on
directive has no indentation (it starts on first character of the line)When these three conditions apply, Black errors out with the message that "Black produced code that is not equivalent to the source."
To Reproduce
Expected behavior
Black should reformat the source listed above to:
Environment (please complete the following information):
Does this bug also happen on master?
Yes, I have reproduced this bug on my local machine, at the current head of master (fb1ac69) (and I've verified that all tests pass, though I had to follow what the TravisCI job does rather than following the instructions in the bug report issue template or in CONTRIBUTING.md).
Additional context
This is the AST diff log file that black writes when trying to format a file containing only the problematic source listed above.
The text was updated successfully, but these errors were encountered: