5 ms·
> We still don't have format selection And you never will. From https://github.com/psf/black https://github.com/psf/black: Black is the uncompromising Python
by LittlePeter 4y ago
> We still don't have format selection
And you never will. From https://github.com/psf/black https://github.com/psf/black:
Black is the uncompromising Python code formatter. By using it, you agree to cede control over minutiae of hand-formatting. In return, Black gives you speed, determinism, and freedom from pycodestyle nagging about formatting. You will save time and mental energy for more important matters.
- sph 4y agoUnless your back-and-forth flew over my head, GP is referring to being able to format a range of lines in a file (i.e. a selection), they're not talking about selecting a formatting style.
- LittlePeter 4y agoYou are right, I probably misunderstood. But now I am curious, what is the use case for formatting just a range of lines and not the entire file?
- sph 4y agoMaybe formatting just the lines you've modified: on Emacs I'm a big fan of dtrt-indent, which fixes the indentation only on the lines you've modified, without breaking the style of the rest of the file. Great when collaborating on an open-source project. The default "format-on-save" setting would reformat the entire file, creating huge diffs for simple changes.
- BenGosub 4y agoIt's very handy for when you copy something in the editor and the file is not saved, you probably don't intend to save it, but you want to format the code, because it will be more readable.