I'm trying to format my code with autopep8 (because this appears to be the default one in VSCode). But there is a problem with it:
I am using a lib that doesn't care about typing, so I need to suffix some lines with # type:ignore
to make the linter ignore that particular file. But when formatting (with autopep8) the formatter moves the comment to the line above. Then my linter doesn't ignore the line like it should.
So with e.g. this code:
somevar = dumblib.foobar() #type:ignore
I hit Shift+Alt+F to format, and then the code is formatted to this:
# type:ignore
somevar = dumblib.foobar()
And then, the linter complains that the type of "somevar" is unknonwn.
How can I prevent autopep8 from moving the comment during a reformat?