I'm trying to set Visual Studio Code to format using autopep8
but ignoring E266 (too many leading '#' for block comments) to allow Markdown sub-headings in comments.
--ignore setting seems to work for other errors, like E302, but not specifically for E266.
My formatting config is below, E266 still gets enforced, even though E302 is ignored:
"python.formatting.provider": "autopep8",
"python.formatting.autopep8Args": [
"--ignore",
"E266,E302",
// E266 = multiple-# in comments
// E302 = expect 2 blank lines before def
],
With the config above, autopep8 will ignore E302 (so it won't insert lines before def), but it continues to remove extra # in comments per E266.
I can set my Linter to ignore E266 so it doesn't get underlined in the UI, but not the Formatter that modifies the code. This is the Linter config which works fine
"python.pythonPath": "...path...",
"python.linting.pep8Enabled": true,
"python.linting.pep8Args": [
"--ignore=E266"
// E266 = multiple-# in comments
],
"python.linting.pylintPath": "...path...",
"python.linting.pylintArgs": [
"--load-plugins",
"pylint_django"
],
"python.linting.pylintEnabled": true,
Is there an overlapping rule that's similar to E266 that's causing the Formatter to still make the change despite ignoring E266? Doesn't appear so since the lines being edited are not identified by the Linter when ignoring E266.
Example.py for sample usage
## These lines will lose one "#" when Formatted in VSCode
## Even though we set it to ignore E266