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.

bandit linter messages don't appear in the "Problems" tab

See original GitHub issue

Environment data

  • VS Code version: 1.54.0
  • Extension version (available under the Extensions sidebar): v2021.2.582707922
  • OS and version: Linux x64 5.11.2-arch1-1
  • Python version (& distribution if applicable, e.g. Anaconda): 3.5.10
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): venv
  • Relevant/affected Python packages and their versions:
  • Relevant/affected Python-related VS Code extensions and their versions: pylance-2021.3.0
  • Value of the python.languageServer setting: pylance-2021.3.0

Expected behaviour

See issues reported by bandit in the “Problems” tab.

Actual behaviour

Bandit output is visible in the “Output tab”, but not in the “Problems” tab.

Steps to reproduce:

image image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
karrtikrcommented, Mar 9, 2021

PR which introduced this change https://github.com/microsoft/vscode-python/pull/15003. Original issue https://github.com/microsoft/vscode-python/issues/12118

FYI @tonybaloney we may have to revert that PR.

1reaction
karthiknadigcommented, Mar 9, 2021

Looks like we need to remove col from custom message format and pass a custom regex to run parse the message: https://github.com/Microsoft/vscode-python/blob/49a785398dfd07f82365266181fddab4cf5f20c6/src/client/linters/bandit.ts#L26-L38

This regex should be enough:

(?<line>\d+),(?<type>\w+),(?<code>\w+\d+):(?<message>.*)\r?(\n|$)
Read more comments on GitHub >

github_iconTop Results From Across the Web

bandit linter doesn't seem to work inside vscode #3722 - GitHub
Actual behaviour. Doesn't show the message with the issue shown above. In fact it doesn't show anything. If I run the command
Read more >
Error message "Linter pylint is not installed" - Stack Overflow
Check the path Pylint has been installed to, by typing which pylint on your terminal. You will get something like: /usr/local/bin/pylint.
Read more >
Linting Python in Visual Studio Code
Linting highlights syntactical and stylistic problems in your Python source code, which often helps you identify and correct subtle programming errors or ...
Read more >
Python static analysis comparison: Bandit vs Semgrep - r2c
A deep dive tool comparison.
Read more >
Configuration — Bandit documentation - Read the Docs
Bandit is designed to be configurable and cover a wide range of needs, it may be used as either a local developer utility...
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