-
Notifications
You must be signed in to change notification settings - Fork 67
Description
Firstly, thanks for providing the VSCode Ruff extension. It's great!
My issue:
Ruff version: 2025.26.0
VS Code version: 1.104.0
If I have a workspace open in VSCode and then open a file outside of the workspace, often that file fails to find the Ruff settings, giving error:
2025-09-17 15:12:58.584689000 WARN No settings available for file:///c%3A/Users/vincluff/Documents/_DOCS/my_script_outside_of_workspace.py - falling back to default settings
My file structure:
C:\.ruff.toml
C:\repos\my_app\.ruff.toml
C:\repos\my_app\Source\my_module_in_workspace.py
C:\Users\vincluff\Documents\_DOCS\my_script_outside_of_workspace.py
Both .ruff.toml files contain:
extend-select = ["A", "ANN", "ARG", "B", "C", "D", "D401", "D404", "E", "FURB", "G", "INT", "LOG", "N", "PERF", "PL", "PTH", "RET", "RUF", "SIM", "TID", "Q", "W"]
line-length = 120
[lint.pydocstyle]
convention = "google"
my_module_in_workspace.py and my_script_outside_of_workspace.py contain:
print("hello")
In VSCode I open workspace C:\repos\my_app\Source
and then open my_script_outside_of_workspace.py. No linting is performed on the file (I should get a yellow squiggly for D100) and I get the error:
2025-09-17 15:12:58.584689000 WARN No settings available for file:///c%3A/Users/vincluff/Documents/_DOCS/my_script_outside_of_workspace.py - falling back to default settings
If I set "ruff.nativeServer": "off"
it works fine.
Interestingly, if I copy my_script_outside_of_workspace.py to C:\temp I don't get error "WARN No settings available..." but it still doesn't perform any linting.
This sounds quite similar to #713
I'm happy to provide further information and to help debug if needed.
Ruff language server output:
2025-09-17 15:17:46.434795800 WARN The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `c:\repos\my_app\.ruff.toml`:
- 'extend-select' -> 'lint.extend-select' log.target="ruff_workspace::configuration" log.module_path="ruff_workspace::configuration" log.file="crates\\ruff_workspace\\src\\configuration.rs" log.line=1604
2025-09-17 15:17:46.442972500 INFO Registering workspace: c:\repos\my_app\Source
2025-09-17 15:17:46.444314100 INFO Configuration file watcher successfully registered
2025-09-17 15:18:04.103688500 WARN No settings available for file:///c%3A/Users/vincluff/Documents/_DOCS/my_script_outside_of_workspace.py - falling back to default settings
2025-09-17 15:18:04.107856100 WARN No settings available for file:///c%3A/Users/vincluff/Documents/_DOCS/my_script_outside_of_workspace.py - falling back to default settings
My settings.json:
{
"git.openRepositoryInParentFolders": "never",
"security.workspace.trust.untrustedFiles": "open",
"security.workspace.trust.enabled": false,
// RUNNING VIA DEBUGGER
"launch": {
"configurations": [
{
"name": "Python: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": false,
"cwd": "${fileDirname}", // https://stackoverflow.com/questions/38623138/how-to-set-the-working-directory-for-debugging-a-python-program-in-vs-code
"env": {"PYTHONPATH": "${workspaceFolder}${pathSeparator}${env:PYTHONPATH}"}, // Set this if you want to use a workspace
}
],
"compounds": []
},
// RUNNING TERMINAL
"terminal.integrated.env.windows": {"PYTHONPATH": "${workspaceFolder}${pathSeparator}${env:PYTHONPATH}"},
"workbench.startupEditor": "none",
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
},
"editor.detectIndentation": false,
"editor.minimap.enabled": false,
"python.languageServer": "Pylance",
"debug.terminal.clearBeforeReusing": true,
"python.analysis.typeCheckingMode": "basic",
"workbench.editor.showTabs": "none",
"window.restoreWindows": "none",
"window.confirmSaveUntitledWorkspace": false,
"workbench.editor.empty.hint": "hidden",
"python.defaultInterpreterPath": "C:\\Program Files\\Python313\\python.exe",
"explorer.openEditors.sortOrder": "alphabetical",
"ruff.format.preview": false,
"ruff.nativeServer": "on",
}