Spacing on inline comments with yapf

1.5k Views Asked by At

If I have code with inline comments:

def my_function():
    #my comment
    return 1+1

Flake8 will give me this error --> E262 - inline comment should start with '# '

It wants to see a single space after the "#":

def my_function():
    # my comment
    return 1+1

Now I've been using yapf to automatically fix just this kind of thing in my code files, and it works great. But it seems to ignore this particular pep8 error. I was wondering is there some style setting I can use to configure yapf to add this space? Or do I need to find another formatter for that?

Running yapf version '0.24.0' in python 3.6.

1

There are 1 best solutions below

0
On BEST ANSWER