format code does not right-trim docstrings
Brought to you by:
fabioz
If I turn on the "right trim lines" code-formatting preference, I would expect that all affected lines, including in docstrings, would be right-trimmed. However, it appears that lines in triple-quoted strings will not have the whitespace cleaned.
Actually, that's done on purpose, because triple-quoted strings are actually used as strings, so, trimming those could make the semantic of your program change (as they're not really comments, but actual strings you can use in your code).
If you really feel this is needed, maybe an option could be added, but note that I don't feel this should be generally recommended.
If it were easy to edit docstrings without introducing lots of trailing whitespace by accident, I would probably agree with you. However, if I hit "return return" to add a blank line, I've just added a bunch of trailing spaces, unless I go "up-arrow delete delete" after I'm finished editing.
Perhaps this could be done for *docstrings*, but not for arbitrary triple-quoted strings?
This is the one feature of pydev which frustrates me.
I concur with glyf's suggestions - that if it was possible to do this for docstrings only that would be great. Otherwise, providing it as an option at least.