Skip to content

bandit linter doesn't seem to work inside vscode #3722

@jcrmatos

Description

@jcrmatos

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions