3 ms·
Sounds like a bug in your formatter, if it's meant to just do formatting but actually replaces valid syntax with invalid.
by dmurray 6y ago
Sounds like a bug in your formatter, if it's meant to just do formatting but actually replaces valid syntax with invalid.
- psalminen 6y agoI don't totally disagree. My company uses the black formatter, which does this[0]. There are flags to skip string formatting, but is frowned upon at my organization. [0] https://github.com/psf/black/blob/master/docs/the_black_code_style.md#strings https://github.com/psf/black/blob/master/docs/the_black_code...
- nimih 6y agoFor what it's worth, black appears to do a reasonable thing and preserves the semantics of your quoted strings (as is promised by the documentation): $ echo "'foo'" | black - "foo" $ echo "'foo[\"bar\"]'" | black - 'foo["bar"]' $ echo "'foo[\"bar\"]+\\'baz\\''" | black - "foo[\"bar\"]+'baz'"