RFC: Have yapf manage '\' line breaks
- Dominant language
- Python
- Stars
- 14k
- Forks
- 904
- PR merge metrics
- No merged PRs in 30d
Description
I understand that modifiying the token stream is generally discourage and otherwise nasty buisness in this project.
ex: **"Please manage commas"**: https://github.com/google/yapf/issues/274
There was talk in the referenced (similar) ticket that changes would be considered provided they were behind a knob and thoroughly tested. Lately much of my time has been in a code base with somewhat "eagar" line breaking. Many of which use `\` for such.
```
foo = \
'bar'
vs
foo = 'bar'
```
yapf has done an amazing job at combining these unneeded breaks, but currently doesn't get mess with the above case.
My proposal (if any) would be to add support to remove `\` where the lines would not break the defined column length. yapf seems to deal with the case where the lines are too long just fine so I don't see any reason to actually add them. With hope create an easy/safe way to handle this,#274 and related cases. Is this something of interest here, would a PR be consider given knob/s and tests.?
For my cases I can _probably_ just toss a `sed` in front of the yapf call, but it would be nice if the tool owned this logic. yapf has become a standard tooling for the python projects at our work and its fairly easy to sell adding/changing a knob.
thoughts?
Contributor guide
Assessment
This issue has not been assessed yet.