简体   繁体   中英

Python Flake 8 Lint can't ignore specific errors working in Sublime Text 3

I set specific errors ("D", "E123", "E126") to ignore in default Flake8Lint.sublime-settings:

{
    "python_interpreter": "auto",
    "builtins": [],
    "pyflakes": true,
    "pep8": true,
    "pydocstyle": true,
    "naming": true,
    "import-order": true,
    "import-order-style": "google",
    "complexity": -1,
    "pep8_max_line_length": 79,
    "select": [],
    "ignore": ["D", "E123", "E126"],
    "ignore_files": []
}

But those errors are still detected and displayed. Does anyone know how to fix it? Thank you!

I have two suggestions:

  1. Use Sublime Linter . It looks like you are using the Python Flake8 Lint package which is no longer maintained (see the note at the top of the readme here ). Sublime Linter is a great package which is well maintained and very extensible.
  2. Once you have Sublime Linter installed and running, follow the instructions at https://hightower.space/thoughts/sublime-linter-ignore-guide/ for ignoring linter errors. I ran into some similar problems trying to ignore linter errors and wrote a short guide on how to ignore Sublime Linter errors.

If you don't want to install Sublime Linter, you can see if any of these changes work:

"ignore": "D,E123,E126",

or replace the "ignore" key with:

"args": "--ignore D,E123,E126",

I know flake8 changed the way rules are ignored earlier this year (there is an issue about it here ) and I'm guessing the package you are using hasn't been updated to facilitate this change.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM