google / yapf

A formatter for Python files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

May I ask how to automatically add a space after "#" when using yapf? I haven't found such configuration. Thank you.

jiayouzl opened this issue · comments

commented

May I ask how to automatically add a space after "#" when using yapf? I haven't found such configuration. Thank you.

image

YAPF doesn't mess with the token stream in this way. So all comments are kept "as is" without us trying to reformat them. This is to keep us from messing up some specialized comment formats, like "#. <translation>" for translation efforts.

Some editors / IDEs have this. (On Emacs, I have something bound to the tab key that auto-formats same-line comments: indent-for-tab-command)