Issue
I am working on a Python project where the Formatting is set to Autopep8. Is there any extension or possible settings where can define to exclude a certain line(s) from formatting when VS is set to format modified code/file on save or with keyboard shortcuts?
Solution
Add the comment # noqa
to the end of each line you want VS Code to leave alone. For instance, to prevent VS Code from changing
RED = 0
YELLOW = 1
to
RED = 0
YELLOW = 1
just do the following:
RED = 0 # noqa
YELLOW = 1 # noqa
Answered By - Thomas
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.