2 ms·
I must admit I didn't. I felt confident it was restricted to adding and removing whitespace because the README says at the start: > Black ignores previous form
by quietbritishjim 8y ago
I must admit I didn't. I felt confident it was restricted to adding and removing whitespace because the README says at the start:
> Black ignores previous formatting and applies uniform horizontal and vertical whitespace to your code.
I now see it does sometimes modify non-whitespace characters e.g. later in the README it mentions:
> In [certain] cases, parentheses are removed when the entire statement fits in one line
I'm not in a position to test black out right now (I can't run Python on the computer I'm posting this comment on). I'd be curious to know what it does on the code I posted, and on over-length comments and string literals.
- freyir 8y agoI tried it. Black doesn't seem to touch long strings or comments. It just leaves you with "line too long" errors that you can clean up yourself. For your code example, see my comment above.