-
Couldn't load subscription status.
- Fork 1.3k
Description
Issue Type: Bug
Behaviour
I noticed when debugging Issue #4074 that flake8 obviously fails to run when
"python.linting.flake8Path"is set incorrectly (i.e. path is wrong), but vscode does not issue a warning that it cannot find flake8 (i.e. that the path is incorrect).
In my case, I accidentally typed ${workspacefolder} in all lowercase instead of camelCase (i.e. ${workspaceFolder}), so the variable didn't expand.
I have editor.formatOnSave set to true, so after saving my python code, the OUTPUT tab of vscode showed this:
.\.venv\Scripts\python.exe ~\.vscode\extensions\ms-python.python-2022.6.0\pythonFiles\linter.py -p flake8 ${workspacefolder}/.venv/Scripts/flake8.exe the_file.py
This is how I noticed I typed in the variable incorrectly.
Expected vs. Actual
vscode doesn't issue a warning that it cannot find flake8, but fails silently (flake8 doesn't run).
Instead, it would be preferrable that vscode checks the path/binary exists (or that there be a style checker for settings.json that checks if variables like ${workspaceFolder} are typed correctly).
Steps to reproduce:
- Create a python virtual envrionment in a project folder
> py -3.8 -m venv .venv- pip install flake8
> py -m pip install flake8- Set
editor.formatOnSavetotrueand addflake8to linters in workspacesettings.json, but type${workspacefolder}with incorrect case sensitivity
{
"editor.formatOnSave": true,
...
"python.linting.flake8Enabled": true,
"python.linting.flake8Path": "${workspaceFolder}/.venv/Scripts/flake8.exe",
...
}Now, flake8 errors will not be caught (linted) by vscode and user will not know why unless thy read the OUTPUT tab log and discover their path to flake8 is incorrect.
Diagnostic data
- Python version (& distribution if applicable, e.g. Anaconda): 3.8.10
- Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Poetry
- Value of the
python.languageServersetting: Default
User Settings
defaultLS: {"defaultLSType":"Pylance"}
envFile: "<placeholder>"
venvPath: "<placeholder>"
venvFolders: "<placeholder>"
condaPath: "<placeholder>"
pipenvPath: "<placeholder>"
poetryPath: "<placeholder>"
languageServer: "Pylance"
linting
• enabled: true
• cwd: "<placeholder>"
• Flake8Args: "<placeholder>"
• flake8Enabled: true
• flake8Path: "<placeholder>"
• lintOnSave: true
• banditArgs: "<placeholder>"
• banditEnabled: true
• banditPath: "<placeholder>"
• mypyArgs: "<placeholder>"
• mypyEnabled: true
• mypyPath: "<placeholder>"
• pycodestyleArgs: "<placeholder>"
• pycodestyleEnabled: false
• pycodestylePath: "<placeholder>"
• prospectorArgs: "<placeholder>"
• prospectorEnabled: false
• prospectorPath: "<placeholder>"
• pydocstyleArgs: "<placeholder>"
• pydocstyleEnabled: false
• pydocstylePath: "<placeholder>"
• pylamaArgs: "<placeholder>"
• pylamaEnabled: false
• pylamaPath: "<placeholder>"
• pylintArgs: "<placeholder>"
• pylintPath: "<placeholder>"
sortImports
• args: "<placeholder>"
• path: "<placeholder>"
formatting
• autopep8Args: "<placeholder>"
• autopep8Path: "<placeholder>"
• provider: "black"
• blackArgs: "<placeholder>"
• blackPath: "<placeholder>"
• yapfArgs: "<placeholder>"
• yapfPath: "<placeholder>"
testing
• cwd: "<placeholder>"
• debugPort: 3000
• nosetestArgs: "<placeholder>"
• nosetestsEnabled: undefined
• nosetestPath: "<placeholder>"
• promptToConfigure: true
• pytestArgs: "<placeholder>"
• pytestEnabled: true
• pytestPath: "<placeholder>"
• unittestArgs: "<placeholder>"
• unittestEnabled: false
• autoTestDiscoverOnSaveEnabled: true
terminal
• activateEnvironment: true
• executeInFileDir: "<placeholder>"
• launchArgs: "<placeholder>"
experiments
• enabled: true
• optInto: []
• optOutFrom: []
tensorBoard
• logDirectory: "<placeholder>"
Extension version: 2022.6.0
VS Code version: Code 1.67.0 (57fd6d0195bb9b9d1b49f6da5db789060795de47, 2022-05-04T12:06:02.889Z)
OS version: Windows_NT x64 10.0.19042
Restricted Mode: No
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Xeon(R) Gold 6248R CPU @ 3.00GHz (48 x 2993) |
| GPU Status | 2d_canvas: enabled canvas_oop_rasterization: disabled_off direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on oop_rasterization: enabled opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_renderer: enabled_on video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled |
| Load (avg) | undefined |
| Memory (System) | 190.65GB (115.37GB free) |
| Process Argv | --crash-reporter-id 9e9db912-c31c-4be1-8c40-4080829b5095 |
| Screen Reader | no |
| VM | 0% |
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
pythonvspyl392:30443607
pythontb:30283811
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805cf:30301675
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
pythonvsnew555:30457759
vscscmwlcmt:30465135
cppdebugcf:30475217