0

Say, I want to format following python file with autopep8:

## Double '#' at the start of this line will be removed due to E265/E266

# extra space after '=' will be removed due to E222
a =  1

But I want to ignore E265/E266 rules for entire file (and only this file), while keeping other autopep8 rules in place - as configured in pyproject.toml globally

Disabling autopep8 for entire file by placing # autopep8: off at the start of the file is obviously not the option. Placing # nopep8 and # noqa at the end of respective line works for linter warnings, but not for autopep8

infi
  • 13
  • 3
  • 1
    Perhaps just run `autopep8` twice: once with `--exclude` to do nothing for this one file, and again with `--ignore` on just this one file. – chepner Jan 27 '23 at 14:23

0 Answers0