Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The latest v2023.18.0 is causing the linter option to run bandit which is not available and auto-enabling the default (.venv) even when not requested. #22163

Closed
iamibi opened this issue Oct 5, 2023 · 9 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Needs assignment to the proper sub-team

Comments

@iamibi
Copy link

iamibi commented Oct 5, 2023

I updated the python extension to the latest and I started receiving errors that the extension was trying to run bandit linter (i never configured it). Additionally, not some random .venv is activated on the vscode terminal (again, not my configuration). I have to manually set the bash source to .bashrc and then activate my custom virtual environment (separate from the one that was activated by the extension).

Rolling back the python extension to v2023.16.0 resolved this issue for me.

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Oct 5, 2023
@karthiknadig
Copy link
Member

@iamibi Can you share your user and workspace settings?

@karthiknadig karthiknadig self-assigned this Oct 5, 2023
@karthiknadig karthiknadig added the bug Issue identified by VS Code Team member as probable bug label Oct 5, 2023
@karthiknadig karthiknadig added this to the September 2023 Recovery 1 milestone Oct 5, 2023
@github-actions github-actions bot added the info-needed Issue requires more information from poster label Oct 5, 2023
@dipasqualew
Copy link

Same happens to me, but with flake8. I use ruff. No mentions of Python linters in my setting files.

@maltsev
Copy link

maltsev commented Oct 6, 2023

Same for me (for flake8).

@iamibi
Copy link
Author

iamibi commented Oct 6, 2023

@iamibi Can you share your user and workspace settings?

I was able to figure out the issue. So, I was using WSL and even though my workspace settings never mentioned anything about bandit linting, the WSL settings (located in ~/.vscode-server/data/Machine/settings.json) were having these references. After removing them and updating the plugin to the latest version fixed the issue.

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Oct 6, 2023
@dipasqualew
Copy link

dipasqualew commented Oct 6, 2023

Thanks @iamibi – I use a Mac, so the WSL solution doesn't apply to me unfortunately.

Any clues on how you found the offending setting file?

Edit:

Found the solution, at least for me. Here are the steps:

  1. Open the command palette, select "Preferences: Open User Settings (JSON)"
  2. Find the relevant entry (for flake8, it is python.linting.flake8Enabled)
  3. Set it to false

@maltsev I suspect it might fix it for you as well!

@iamibi
Copy link
Author

iamibi commented Oct 6, 2023

Weird that this issue started popping up after the recent update. Something was fixed (un)knowingly. Maybe the team can say it "It's not a bug, it's a feature :P"

@karthiknadig
Copy link
Member

The default for most of these is false:

vscode-python/package.json

Lines 682 to 683 in e7dfef8

"python.linting.banditEnabled": {
"default": false,

vscode-python/package.json

Lines 783 to 784 in e7dfef8

"python.linting.flake8Enabled": {
"default": false,

It should not trigger these linters unless explicitly set to true. You can also just remove any setting that enables any of the linters.

@maltsev
Copy link

maltsev commented Oct 7, 2023

Found the solution, at least for me. Here are the steps:

  1. Open the command palette, select "Preferences: Open User Settings (JSON)"
  2. Find the relevant entry (for flake8, it is python.linting.flake8Enabled)
  3. Set it to false
    @maltsev I suspect it might fix it for you as well!

Thanks! Actually, that was the first thing I tried :-) It did solve the issue for some workspaces but not for other ones. So in the end, I just installed the new flake8 plugin.

@karthiknadig
Copy link
Member

This is now fixed in pre-release

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

4 participants