Open JelleZijlstra opened 1 year ago
Yeah could be nice 👌 For line length, we could perhaps consider the non-whitespace portion only. For a given line in a diff, we know the post-formatting indentation and could then compare the line length that it would've produced. Splits would be harder though. Or we could indent in another pass since it's such a fundamental formatting move :P (perhaps let's not)
Currently, Black checks that the AST of its input and output is the same (except for some narrow exceptions). This is a powerful feature that has caught many bugs (e.g. most recently #3428).
Could we add more similar checks?
The downside of adding more safety checks is that it will make Black slower. But if users want speed over safety, they can use
--fast
already, so if the overhead of a comment equivalence check isn't too bad, I think we should do it.