question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Flake8 more native support

See original GitHub issue

Good day. Thank you for your work with that beautiful plugin and vscode at all.

I newbie with vscode, but I found, that your plugin match only F, W and E error codes. I use a lot of flake8 plugins, which have another letter (or letters) for codes. Have you any plans to support absolutely custom codes, as user want? For example, dict with code: level match:

flake8CategorySeverity: {
    "F": "error",
    "FF": "warning",
    "FOO": "info",
    "BAR": "none",
}

Logs

No response

Code of Conduct

  • I agree to follow this project’s Code of Conduct

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:19
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
karthiknadigcommented, Feb 12, 2022

@Niccolum You can see the logic for severity in the linter_server.py, (in the extensions folder). The way it works now is that if you set:

"python.flake8Severity":{
        "W": "Error",
    }

Then it does not know about F, E, or other types of codes. The severity setting literally replaces the look up. If it cannot find anything it uses Error.

def _get_severity(code, codeType, severity):
    value = severity.get(code, None) or severity.get(codeType, "Error")
    try:
        return types.DiagnosticSeverity[value]
    except Exception:
        pass

    return types.DiagnosticSeverity.Error

Here code can take values like (F401, E302, E305), codeType can take values like (F, E, I, T, W), severity is literally what you set in the severity setting. In the above case { "W": "Error", }

1reaction
karthiknadigcommented, Feb 11, 2022

the flake8 extension can work with the python extension. By default, it uses flake8 that you have installed in your environment, if that flake8 has plugins it should work. If you don’t have flake8 installed, it will use the bundled flake8. You can also use a path to a flake8 binary if you prefer to use a global flake8.

You may want to disable linting with python extension, or you will see two items for each linting issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Full Listing of Options and Their Descriptions - Flake8
Show a description of how to use Flake8 and its options. Command-line usage: flake8 --help flake8 -h. This can not be specified in...
Read more >
flake8 - Pants build
The Flake8 Python linter (https://flake8.pycqa.org/). Backend: pants.backend.python.lint. ... Read that option's help message for more info on resolves.
Read more >
Descriptive flake8 errors in PyCharm - python - Stack Overflow
I've wrote a library that offer - kind of native flake8 integration with pycharm. The library work by pretending to be a pylint...
Read more >
Style - Scikit-HEP
Pre-commit; Black; Check-Manifest; Type checking; PyCln; Flake8; YesQA; isort; PyUpgrade ... This tool, setup-cfg-fmt , has native support for pre-commit:.
Read more >
flake8-bugbear - PyPI
A plugin for flake8 finding likely bugs and design problems in your program. ... B002: Python does not support the unary prefix increment....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found