LibCST icon indicating copy to clipboard operation
LibCST copied to clipboard

Incorrect validation: space after 'while' keyword

Open sirosen opened this issue 5 months ago • 0 comments

I was working on a linter/fixer tool and decided to test it against the stdlib to see what it would do. I was surprised to see it fail on some stdlib modules with CSTValidationErrors.

I can report a number of these if they are useful to have tracked. I've so far seen "space after 'del'" and "space after 'while'".

Limiting ourselves to the while case, here's a trivial reproducer:

while(True):
    pass

From the stdlib, this is in difflib. Example snippet:

while(num_blanks_to_yield < 0):
    num_blanks_to_yield += 1
    yield None,('','\n'),True

sirosen avatar Feb 01 '24 17:02 sirosen