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 doesn't seem to work inside vscode

See original GitHub issue

Environment data

  • VS Code version: 1.30.0
  • Extension version (available under the Extensions sidebar): 2018.12.1
  • OS and version: Windows 7 Pro SP1 with all updates
  • Python version (& distribution if applicable, e.g. Anaconda): 3.5.4
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): virtualenv
  • Relevant/affected Python packages and their versions: bandit 1.4.0

Expected behaviour

These settings either in user settings or workspace settings should allow bandit to run

    "python.linting.banditArgs": [
        "-s", "B101",
        "-f", "csv",
    ],
    "python.linting.banditEnabled": true,

at it should return this

[main]  INFO    profile include tests: None
[main]  INFO    profile exclude tests: None
[main]  INFO    cli include tests: None
[main]  INFO    cli exclude tests: B101
[main]  INFO    running on Python 3.5.4
filename,test_name,test_id,issue_severity,issue_confidence,issue_text,line_number,line_range
uniclave\uniclave_import.py,blacklist,B404,LOW,HIGH,Consider possible security implications associated with call module.,14,[14]
uniclave\uniclave_import.py,subprocess_without_shell_equals_true,B603,LOW,HIGH,subprocess call - check for execution of untrusted input.,59,"[59, 60]"

when it checks this line from subprocess import call in uniclave\uniclave_import.py

Actual behaviour

Doesn’t show the message with the issue shown above. In fact it doesn’t show anything.

If I run the command bandit -s B101 -f csv uniclave\uniclave_import.py from the integrated terminal or the cmd console it works and shows the message.

Steps to reproduce:

Shown above.

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

There is no message in the Output panel.

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

There is no output in the console from the Developer Tools.

flake8, pylint and mypy are running without a problem on the same file.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jcrmatoscommented, Dec 19, 2018

Didn’t know about that selection of the Output panel. Thanks for info. And thank you for the help.

0reactions
jcrmatoscommented, Dec 20, 2018

OK, thanks again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

bandit linter doesn't seem to work inside vscode #3722 - GitHub
Do make sure that you installed bandit into the environment you selected in VS Code (easiest way to to run bandit for the...
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 >
why are pylint's error squiggle lines not showing in python ...
In your settings.json file(search for settings.json in the command palette), declare the following: "python.linting.
Read more >
Advanced Visual Studio Code for Python Developers
You can use VS Code as a lightweight code editor to make quick changes, ... For example, Bandit is a linter for security...
Read more >
“linter pylint is not installed” in VSCode - LinuxPip
So, fixing "pylint is not installed" can be as easy as updating VSCode to the latest version to make use of the new...
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