How can I keep spaces before comments?

Spaces before comment are always disappeared when reformatting the code.

Is there any option related to this? I want to align comments to match with red line.

1
2 comments

Hi,

Unfortunately there doesn't seem to be a way to disable that. There are some settings related to spaces and "#" in "File | Settings | Editor | Code Style | Python >> Spaces", but this particular behavior doesn't seem to be configurable. 

Please feel free to create a feature request in our issue tracking sytem: https://youtrack.jetbrains.com/issues?q=project:pycharm

0

Any chance support for additional whitespace has been added? I'd like to use the reformat feature, but can't without it messing up my comments:

print('foo')          # I want to align my spaces
print('another foo') # In some cases it helps readability
print('last one') # This is a trivial example
0

Please sign in to leave a comment.