I have a problem with the name of a var in a python file, using VSCode and autopep8, this is an example:
...
formal_education: bool
...
Autopep formater change the format like this:
...
formal_education:
bool
...
Raising a SyntaxError detected by flake8, so, I have tried special comments like: # autopep8: noqa
and others using some specific PEPs but seems like the editor skip some phase previous to and seem imposible to avoid this behaviour.
I know that the problem is about for word inside of var name.
A solution for now is disable the format check in save stage
"editor.formatOnSave": false
, but I would like to know how to solve this, maybe some config to autopep or maybe directly over VSCode, or how to apply special comments directly in the file to achieve this goal.
Thanks!
I am using:
Although this is old, here's a solution:
Just put # nopep8
at the end of the line(s) that shouldn't be formatted
Hope this can still help someone!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With