How can I keep spaces before comments? Permanently deleted user Created December 30, 2018 07:19 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.
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
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 spacesprint('another foo') # In some cases it helps readability
print('last one') # This is a trivial example