In reply to this post by David Chisnall via cfe-dev
Thanks for your feedback, and I appreciate the link and the logic behind it.
Unfortunately, by stripping all trailing whitespace, clang-format has made a policy decision, but with no way to control it via the configuration. I understand it's not desirable for every option to be configurable, but this is something which significantly affects existing code. I propose that it would be good to have an option "TrailingWhitespace: Truncate|Preserve|Fix". Truncate would be existing behaviour. Preserve would not alter leading whitespace on blank lines or touch trailing whitespace. Fix would fix leading whitespace on blank lines, fix trailing whitespace on code, but avoid making any changes in comments except if it was reflowed. It could be more granular but that's where I'd start.
## Some objective problems:
- Existing code which is indented this way would require a lot of changes.
- Markdown (which is useful in comments) is sensitive to trailing whitespace.
It's possible to add a post process script to normalise leading whitespace but not trailing whitespace (e.g. in the case of markdown).
## Some subjective problems:
- It's my preference when I start editing on a line, the indentation is correct already.
- When moving cursor up and down it's my preference that it doesn't jump back and forward when crossing blank lines.
Some of these issues can be fixed by editor configuration/plugins, but it's still not 100% correct.