Different behaviour Ruff vscode extension and Ruff `uv run ruff format .`
I am using the VSCODE extension of RUFF to format on save in vscode. And I am using ruff in my Gitlab pipeline to check.
I get different behaviour when the extension does a format in VSCODE compared to if i would do a ruff format from the command line:
The vscode extension does this onSave:
def find_ymax(gef_files: List[GefFileModel]) -> float:
"""Find the highest top level of multiple CPTs"""
top_levels = [
max(gef.elevation[0], gef.ground_level_wrt_reference) for gef in gef_files
]
return max(top_levels)
Whereas ruff format . gives me this:
def find_ymax(gef_files: List[GefFileModel]) -> float:
"""Find the highest top level of multiple CPTs"""
top_levels = [max(gef.elevation[0], gef.ground_level_wrt_reference) for gef in gef_files]
return max(top_levels)
It is really annoying that these two things are fighting each other.
This is my pyproject.toml:
[tool.ruff]
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]
line-length = 120
indent-width = 4
target-version = "py312"
[tool.ruff.lint]
select = ["E4", "E7", "E9", "F", "I"]
ignore = []
fixable = ["ALL"]
unfixable = []
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
docstring-code-format = true
docstring-code-line-length = "dynamic"
Both methods are using ruff==0.14.0
This is my vscode settings file:
"ruff.importStrategy": "useBundled",
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file",
"editor.codeActionsOnSave": {
"source.fixAll": "always"
},
"files.autoSave": "onFocusChange",
It seems that VS code isn't picking up your pyproject.toml because it formats the code with a line width of 88 (or anything less than 120 :)).
Can you follow the troubleshooting guide and set the log level to DEBUG and then share the logs (after a restart, then format the file) with us.
Ok, this is the log:
2025-10-14 11:59:58.192675600 DEBUG Negotiated position encoding: UTF16
2025-10-14 11:59:58.194028800 DEBUG Indexing settings for workspace: c:\users\mweehuizen\viktor-apps\libbase
2025-10-14 11:59:58.195539000 DEBUG Detected minimum supported `requires-python` version: 3.12 log.target="ruff_workspace::pyproject" log.module_path="ruff_workspace::pyproject" log.file="crates\\ruff_workspace\\src\\pyproject.rs" log.line=237
2025-10-14 11:59:58.195662500 DEBUG Derived `target-version` from found `requires-python` for fallback configuration: Py312
2025-10-14 11:59:58.204421700 DEBUG Loaded settings from: `c:\users\mweehuizen\viktor-apps\libbase\pyproject.toml` for `c:\users\mweehuizen\viktor-apps\libbase`
2025-10-14 11:59:58.205735400 DEBUG Ignored path via `exclude`: c:\users\mweehuizen\viktor-apps\libbase\.git
2025-10-14 11:59:58.206216500 DEBUG Ignored path via `exclude`: c:\users\mweehuizen\viktor-apps\libbase\.ruff_cache
2025-10-14 11:59:58.206196600 DEBUG Ignored path via `exclude`: c:\users\mweehuizen\viktor-apps\libbase\.pytest_cache
2025-10-14 11:59:58.211686200 INFO Registering workspace: c:\users\mweehuizen\viktor-apps\libbase
2025-10-14 11:59:58.212369900 DEBUG notification{method="textDocument/didOpen"}: enter
2025-10-14 11:59:58.212578100 DEBUG notification{method="textDocument/didOpen"}: enter
2025-10-14 11:59:58.212666300 WARN No settings available for file:///c%3A/Users/mweehuizen/viktor-apps/libbase/src/libbase/gef_folder/plot_helper_functions.py - falling back to default settings
2025-10-14 11:59:58.212726900 DEBUG request{id=1 method="textDocument/diagnostic"}: enter
2025-10-14 11:59:58.212887400 DEBUG request{id=1 method="textDocument/diagnostic"}: Included path via `include`: c:\users\mweehuizen\viktor-apps\libbase\src\libbase\gef_folder\visualisations.py
2025-10-14 11:59:58.213557000 DEBUG request{id=2 method="textDocument/diagnostic"}: enter
2025-10-14 11:59:58.213718500 DEBUG request{id=2 method="textDocument/diagnostic"}: Included path via `include`: c:\Users\mweehuizen\viktor-apps\libbase\src\libbase\gef_folder\plot_helper_functions.py
2025-10-14 11:59:58.215480800 DEBUG request{id=1 method="textDocument/diagnostic"}: Categorized 'typing' as Known(StandardLibrary) (KnownStandardLibrary) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 11:59:58.215781900 DEBUG request{id=1 method="textDocument/diagnostic"}: Categorized 'numpy' as Known(ThirdParty) (NoMatch) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 11:59:58.215920700 DEBUG request{id=1 method="textDocument/diagnostic"}: Categorized 'viktor' as Known(ThirdParty) (NoMatch) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 11:59:58.215936900 DEBUG request{id=1 method="textDocument/diagnostic"}: Categorized 'dataclasses' as Known(StandardLibrary) (KnownStandardLibrary) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 11:59:58.215946800 DEBUG request{id=1 method="textDocument/diagnostic"}: Categorized '.plot_helper_functions' as Known(LocalFolder) (NonZeroLevel) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 11:59:58.216095800 DEBUG request{id=1 method="textDocument/diagnostic"}: Categorized 'plotly.subplots' as Known(ThirdParty) (NoMatch) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 11:59:58.216141000 DEBUG request{id=1 method="textDocument/diagnostic"}: Categorized '..gef_file.model' as Known(LocalFolder) (NonZeroLevel) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 11:59:58.216479600 DEBUG request{id=1 method="textDocument/diagnostic"}: Categorized 'plotly' as Known(ThirdParty) (NoMatch) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 11:59:58.284907400 DEBUG client_response{id=0 method="client/registerCapability"}: enter
2025-10-14 11:59:58.284976800 INFO client_response{id=0 method="client/registerCapability"}: Configuration file watcher successfully registered
2025-10-14 11:59:58.360748900 DEBUG notification{method="$/cancelRequest"}: enter
2025-10-14 11:59:58.376697500 DEBUG notification{method="$/cancelRequest"}: enter
2025-10-14 11:59:58.392334800 DEBUG request{id=3 method="shutdown"}: enter
2025-10-14 11:59:58.392394600 DEBUG request{id=3 method="shutdown"}: Received shutdown request, waiting for shutdown notification
2025-10-14 11:59:58.396502600 DEBUG Received exit notification, exiting
2025-10-14 11:59:58.397759100 INFO Server shut down
2025-10-14 11:59:58.529001600 DEBUG Negotiated position encoding: UTF16
2025-10-14 11:59:58.530444500 DEBUG Indexing settings for workspace: c:\users\mweehuizen\viktor-apps\libbase
2025-10-14 11:59:58.531870300 DEBUG Detected minimum supported `requires-python` version: 3.12 log.target="ruff_workspace::pyproject" log.module_path="ruff_workspace::pyproject" log.file="crates\\ruff_workspace\\src\\pyproject.rs" log.line=237
2025-10-14 11:59:58.531965100 DEBUG Derived `target-version` from found `requires-python` for fallback configuration: Py312
2025-10-14 11:59:58.539410900 DEBUG Loaded settings from: `c:\users\mweehuizen\viktor-apps\libbase\pyproject.toml` for `c:\users\mweehuizen\viktor-apps\libbase`
2025-10-14 11:59:58.541179100 DEBUG Ignored path via `exclude`: c:\users\mweehuizen\viktor-apps\libbase\.git
2025-10-14 11:59:58.541624800 DEBUG Ignored path via `exclude`: c:\users\mweehuizen\viktor-apps\libbase\.pytest_cache
2025-10-14 11:59:58.541608600 DEBUG Ignored path via `exclude`: c:\users\mweehuizen\viktor-apps\libbase\.ruff_cache
2025-10-14 11:59:58.546218000 INFO Registering workspace: c:\users\mweehuizen\viktor-apps\libbase
2025-10-14 11:59:58.546852200 DEBUG notification{method="textDocument/didOpen"}: enter
2025-10-14 11:59:58.547074300 DEBUG notification{method="textDocument/didOpen"}: enter
2025-10-14 11:59:58.547177900 WARN No settings available for file:///c%3A/Users/mweehuizen/viktor-apps/libbase/src/libbase/gef_folder/plot_helper_functions.py - falling back to default settings
2025-10-14 11:59:58.547224900 DEBUG request{id=1 method="textDocument/diagnostic"}: enter
2025-10-14 11:59:58.547406100 DEBUG request{id=1 method="textDocument/diagnostic"}: Included path via `include`: c:\users\mweehuizen\viktor-apps\libbase\src\libbase\gef_folder\visualisations.py
2025-10-14 11:59:58.547887900 DEBUG client_response{id=0 method="client/registerCapability"}: enter
2025-10-14 11:59:58.547918800 INFO client_response{id=0 method="client/registerCapability"}: Configuration file watcher successfully registered
2025-10-14 11:59:58.547889100 DEBUG request{id=2 method="textDocument/diagnostic"}: enter
2025-10-14 11:59:58.547989400 DEBUG request{id=2 method="textDocument/diagnostic"}: Included path via `include`: c:\Users\mweehuizen\viktor-apps\libbase\src\libbase\gef_folder\plot_helper_functions.py
2025-10-14 11:59:58.549428400 DEBUG request{id=1 method="textDocument/diagnostic"}: Categorized 'typing' as Known(StandardLibrary) (KnownStandardLibrary) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 11:59:58.549620000 DEBUG request{id=1 method="textDocument/diagnostic"}: Categorized 'numpy' as Known(ThirdParty) (NoMatch) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 11:59:58.549865600 DEBUG request{id=1 method="textDocument/diagnostic"}: Categorized 'viktor' as Known(ThirdParty) (NoMatch) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 11:59:58.549894400 DEBUG request{id=1 method="textDocument/diagnostic"}: Categorized 'dataclasses' as Known(StandardLibrary) (KnownStandardLibrary) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 11:59:58.549902900 DEBUG request{id=1 method="textDocument/diagnostic"}: Categorized '.plot_helper_functions' as Known(LocalFolder) (NonZeroLevel) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 11:59:58.550005300 DEBUG request{id=1 method="textDocument/diagnostic"}: Categorized 'plotly.subplots' as Known(ThirdParty) (NoMatch) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 11:59:58.550014300 DEBUG request{id=1 method="textDocument/diagnostic"}: Categorized '..gef_file.model' as Known(LocalFolder) (NonZeroLevel) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 11:59:58.550097100 DEBUG request{id=1 method="textDocument/diagnostic"}: Categorized 'plotly' as Known(ThirdParty) (NoMatch) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 12:00:00.305185200 WARN No settings available for file:///c%3A/Users/mweehuizen/viktor-apps/libbase/src/libbase/gef_folder/plot_helper_functions.py - falling back to default settings
2025-10-14 12:00:00.305910700 DEBUG request{id=3 method="textDocument/codeAction"}: enter
2025-10-14 12:00:00.412956700 WARN No settings available for file:///c%3A/Users/mweehuizen/viktor-apps/libbase/src/libbase/gef_folder/plot_helper_functions.py - falling back to default settings
2025-10-14 12:00:00.414115400 DEBUG request{id=4 method="codeAction/resolve"}: enter
2025-10-14 12:00:00.414328400 DEBUG request{id=4 method="codeAction/resolve"}: Included path via `include`: c:\Users\mweehuizen\viktor-apps\libbase\src\libbase\gef_folder\plot_helper_functions.py
2025-10-14 12:00:00.419531100 WARN No settings available for file:///c%3A/Users/mweehuizen/viktor-apps/libbase/src/libbase/gef_folder/plot_helper_functions.py - falling back to default settings
2025-10-14 12:00:00.420312100 DEBUG request{id=5 method="textDocument/formatting"}: enter
2025-10-14 12:00:00.420512900 DEBUG request{id=5 method="textDocument/formatting"}: Included path via `include`: c:\Users\mweehuizen\viktor-apps\libbase\src\libbase\gef_folder\plot_helper_functions.py
2025-10-14 12:00:00.420871900 DEBUG request{id=5 method="textDocument/formatting"}:Printer::print: enter
2025-10-14 12:00:00.433115000 DEBUG notification{method="textDocument/didChange"}: enter
2025-10-14 12:00:00.434924300 WARN No settings available for file:///c%3A/Users/mweehuizen/viktor-apps/libbase/src/libbase/gef_folder/plot_helper_functions.py - falling back to default settings
2025-10-14 12:00:00.435474100 DEBUG request{id=6 method="textDocument/diagnostic"}: enter
2025-10-14 12:00:00.435537200 DEBUG request{id=6 method="textDocument/diagnostic"}: Included path via `include`: c:\Users\mweehuizen\viktor-apps\libbase\src\libbase\gef_folder\plot_helper_functions.py
2025-10-14 12:00:38.194131600 DEBUG request{id=7 method="shutdown"}: enter
2025-10-14 12:00:38.194185900 DEBUG request{id=7 method="shutdown"}: Received shutdown request, waiting for shutdown notification
2025-10-14 12:00:38.197220900 DEBUG Received exit notification, exiting
2025-10-14 12:00:38.198757600 INFO Server shut down
I noticed this line:
2025-10-14 11:59:58.212666300 WARN No settings available for file:///c%3A/Users/mweehuizen/viktor-apps/libbase/src/libbase/gef_folder/plot_helper_functions.py - falling back to default settings
This is the exact file that is not properly formatting.
The complete file looks like this:
from typing import List
from ..gef_file.model import GefFileModel
def find_ymax(gef_files: List[GefFileModel]) -> float:
"""Find the highest top level of multiple CPTs"""
top_levels = [max(gef.elevation[0], gef.ground_level_wrt_reference) for gef in gef_files]
return max(top_levels)
def find_ymin(gef_files: List[GefFileModel]) -> float:
"""Find the lowest bottom level of multiple CPTs"""
bottom_levels = [gef.elevation[-1] for gef in gef_files]
return min(bottom_levels)
I have no idea why it is exluded like this? All other files are working as expected.
This sounds familiar but I wasn't able to find the relevant issue.
I wonder if the issue is that C:\ is encoded as C:%3A
I don't have a windows machine. What do the logs look like for paths where formatting is working?
here is a log when the extension formats a file properly:
2025-10-14 14:10:55.549905700 DEBUG Negotiated position encoding: UTF16
2025-10-14 14:10:55.551745500 DEBUG Indexing settings for workspace: c:\users\mweehuizen\viktor-apps\libbase
2025-10-14 14:10:55.553388300 DEBUG Detected minimum supported `requires-python` version: 3.12 log.target="ruff_workspace::pyproject" log.module_path="ruff_workspace::pyproject" log.file="crates\\ruff_workspace\\src\\pyproject.rs" log.line=237
2025-10-14 14:10:55.553523600 DEBUG Derived `target-version` from found `requires-python` for fallback configuration: Py312
2025-10-14 14:10:55.561291300 DEBUG Loaded settings from: `c:\users\mweehuizen\viktor-apps\libbase\pyproject.toml` for `c:\users\mweehuizen\viktor-apps\libbase`
2025-10-14 14:10:55.562752600 DEBUG Ignored path via `exclude`: c:\users\mweehuizen\viktor-apps\libbase\.git
2025-10-14 14:10:55.563170500 DEBUG Ignored path via `exclude`: c:\users\mweehuizen\viktor-apps\libbase\.ruff_cache
2025-10-14 14:10:55.567394400 INFO Registering workspace: c:\users\mweehuizen\viktor-apps\libbase
2025-10-14 14:10:55.568624200 DEBUG notification{method="textDocument/didOpen"}: enter
2025-10-14 14:10:55.570653100 DEBUG request{id=1 method="textDocument/diagnostic"}: enter
2025-10-14 14:10:55.570828400 DEBUG request{id=1 method="textDocument/diagnostic"}: Included path via `include`: c:\users\mweehuizen\viktor-apps\libbase\src\libbase\geodatabase\gef_import.py
2025-10-14 14:10:55.571738500 DEBUG request{id=1 method="textDocument/diagnostic"}: Categorized 'typing' as Known(StandardLibrary) (KnownStandardLibrary) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 14:10:55.572110100 DEBUG request{id=1 method="textDocument/diagnostic"}: Categorized 'viktor.api_v1' as Known(ThirdParty) (NoMatch) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 14:10:55.572162800 DEBUG request{id=1 method="textDocument/diagnostic"}: Categorized '.constants' as Known(LocalFolder) (NonZeroLevel) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 14:10:55.573275700 DEBUG request{id=2 method="textDocument/codeAction"}: enter
2025-10-14 14:10:55.581195700 DEBUG client_response{id=0 method="client/registerCapability"}: enter
2025-10-14 14:10:55.581285900 INFO client_response{id=0 method="client/registerCapability"}: Configuration file watcher successfully registered
2025-10-14 14:10:55.788949900 DEBUG request{id=3 method="shutdown"}: enter
2025-10-14 14:10:55.789002700 DEBUG request{id=3 method="shutdown"}: Received shutdown request, waiting for shutdown notification
2025-10-14 14:10:55.825067400 DEBUG Received exit notification, exiting
2025-10-14 14:10:55.826091200 INFO Server shut down
2025-10-14 14:10:55.921377200 DEBUG Negotiated position encoding: UTF16
2025-10-14 14:10:55.922442300 DEBUG Indexing settings for workspace: c:\users\mweehuizen\viktor-apps\libbase
2025-10-14 14:10:55.923527500 DEBUG Detected minimum supported `requires-python` version: 3.12 log.target="ruff_workspace::pyproject" log.module_path="ruff_workspace::pyproject" log.file="crates\\ruff_workspace\\src\\pyproject.rs" log.line=237
2025-10-14 14:10:55.923605500 DEBUG Derived `target-version` from found `requires-python` for fallback configuration: Py312
2025-10-14 14:10:55.929203100 DEBUG Loaded settings from: `c:\users\mweehuizen\viktor-apps\libbase\pyproject.toml` for `c:\users\mweehuizen\viktor-apps\libbase`
2025-10-14 14:10:55.930271600 DEBUG Ignored path via `exclude`: c:\users\mweehuizen\viktor-apps\libbase\.git
2025-10-14 14:10:55.930558100 DEBUG Ignored path via `exclude`: c:\users\mweehuizen\viktor-apps\libbase\.ruff_cache
2025-10-14 14:10:55.936351600 INFO Registering workspace: c:\users\mweehuizen\viktor-apps\libbase
2025-10-14 14:10:55.936968200 DEBUG notification{method="textDocument/didOpen"}: enter
2025-10-14 14:10:55.937274300 DEBUG request{id=1 method="textDocument/diagnostic"}: enter
2025-10-14 14:10:55.937317000 DEBUG request{id=2 method="textDocument/codeAction"}: enter
2025-10-14 14:10:55.937482700 DEBUG request{id=1 method="textDocument/diagnostic"}: Included path via `include`: c:\users\mweehuizen\viktor-apps\libbase\src\libbase\geodatabase\gef_import.py
2025-10-14 14:10:55.938556900 DEBUG request{id=1 method="textDocument/diagnostic"}: Categorized 'typing' as Known(StandardLibrary) (KnownStandardLibrary) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 14:10:55.938784400 DEBUG request{id=1 method="textDocument/diagnostic"}: Categorized 'viktor.api_v1' as Known(ThirdParty) (NoMatch) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 14:10:55.938821700 DEBUG request{id=1 method="textDocument/diagnostic"}: Categorized '.constants' as Known(LocalFolder) (NonZeroLevel) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 14:10:55.939394500 DEBUG client_response{id=0 method="client/registerCapability"}: enter
2025-10-14 14:10:55.939430900 INFO client_response{id=0 method="client/registerCapability"}: Configuration file watcher successfully registered
2025-10-14 14:10:56.303243000 DEBUG request{id=3 method="textDocument/codeAction"}: enter
2025-10-14 14:10:56.655452200 DEBUG notification{method="textDocument/didChange"}: enter
2025-10-14 14:10:56.655983400 DEBUG request{id=4 method="textDocument/diagnostic"}: enter
2025-10-14 14:10:56.656041600 DEBUG request{id=4 method="textDocument/diagnostic"}: Included path via `include`: c:\users\mweehuizen\viktor-apps\libbase\src\libbase\geodatabase\gef_import.py
2025-10-14 14:10:56.656379700 DEBUG request{id=4 method="textDocument/diagnostic"}: Categorized 'typing' as Known(StandardLibrary) (KnownStandardLibrary) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 14:10:56.656527500 DEBUG request{id=4 method="textDocument/diagnostic"}: Categorized 'viktor.api_v1' as Known(ThirdParty) (NoMatch) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 14:10:56.656541800 DEBUG request{id=4 method="textDocument/diagnostic"}: Categorized '.constants' as Known(LocalFolder) (NonZeroLevel) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 14:10:56.943772300 DEBUG notification{method="textDocument/didChange"}: enter
2025-10-14 14:10:56.944400800 DEBUG request{id=5 method="textDocument/diagnostic"}: enter
2025-10-14 14:10:56.944622400 DEBUG request{id=5 method="textDocument/diagnostic"}: Included path via `include`: c:\users\mweehuizen\viktor-apps\libbase\src\libbase\geodatabase\gef_import.py
2025-10-14 14:10:56.945004700 DEBUG request{id=5 method="textDocument/diagnostic"}: Categorized 'typing' as Known(StandardLibrary) (KnownStandardLibrary) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 14:10:56.945191200 DEBUG request{id=5 method="textDocument/diagnostic"}: Categorized 'viktor.api_v1' as Known(ThirdParty) (NoMatch) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 14:10:56.945287100 DEBUG request{id=5 method="textDocument/diagnostic"}: Categorized '.constants' as Known(LocalFolder) (NonZeroLevel) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 14:10:57.262857100 DEBUG notification{method="textDocument/didChange"}: enter
2025-10-14 14:10:57.264124500 DEBUG request{id=6 method="textDocument/diagnostic"}: enter
2025-10-14 14:10:57.264195400 DEBUG request{id=6 method="textDocument/diagnostic"}: Included path via `include`: c:\users\mweehuizen\viktor-apps\libbase\src\libbase\geodatabase\gef_import.py
2025-10-14 14:10:57.264421200 DEBUG request{id=6 method="textDocument/diagnostic"}: Categorized 'typing' as Known(StandardLibrary) (KnownStandardLibrary) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 14:10:57.264557600 DEBUG request{id=6 method="textDocument/diagnostic"}: Categorized 'viktor.api_v1' as Known(ThirdParty) (NoMatch) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 14:10:57.264568800 DEBUG request{id=6 method="textDocument/diagnostic"}: Categorized '.constants' as Known(LocalFolder) (NonZeroLevel) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 14:10:58.670429500 DEBUG request{id=7 method="textDocument/codeAction"}: enter
2025-10-14 14:10:58.687681000 DEBUG request{id=8 method="codeAction/resolve"}: enter
2025-10-14 14:10:58.687800300 DEBUG request{id=8 method="codeAction/resolve"}: Included path via `include`: c:\users\mweehuizen\viktor-apps\libbase\src\libbase\geodatabase\gef_import.py
2025-10-14 14:10:58.688062000 DEBUG request{id=8 method="codeAction/resolve"}: Categorized 'typing' as Known(StandardLibrary) (KnownStandardLibrary) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 14:10:58.688208000 DEBUG request{id=8 method="codeAction/resolve"}: Categorized 'viktor.api_v1' as Known(ThirdParty) (NoMatch) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 14:10:58.688223600 DEBUG request{id=8 method="codeAction/resolve"}: Categorized '.constants' as Known(LocalFolder) (NonZeroLevel) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 14:10:58.691966900 DEBUG request{id=9 method="textDocument/formatting"}: enter
2025-10-14 14:10:58.692198300 DEBUG request{id=9 method="textDocument/formatting"}: Included path via `include`: c:\users\mweehuizen\viktor-apps\libbase\src\libbase\geodatabase\gef_import.py
2025-10-14 14:10:58.692548900 DEBUG request{id=9 method="textDocument/formatting"}:Printer::print: enter
2025-10-14 14:10:58.698807500 DEBUG notification{method="textDocument/didChange"}: enter
2025-10-14 14:10:58.699205100 DEBUG request{id=10 method="textDocument/diagnostic"}: enter
2025-10-14 14:10:58.699267100 DEBUG request{id=10 method="textDocument/diagnostic"}: Included path via `include`: c:\users\mweehuizen\viktor-apps\libbase\src\libbase\geodatabase\gef_import.py
2025-10-14 14:10:58.699570100 DEBUG request{id=10 method="textDocument/diagnostic"}: Categorized 'typing' as Known(StandardLibrary) (KnownStandardLibrary) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 14:10:58.699783900 DEBUG request{id=10 method="textDocument/diagnostic"}: Categorized 'viktor.api_v1' as Known(ThirdParty) (NoMatch) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 14:10:58.699804900 DEBUG request{id=10 method="textDocument/diagnostic"}: Categorized '.constants' as Known(LocalFolder) (NonZeroLevel) log.target="ruff_linter::rules::isort::categorize" log.module_path="ruff_linter::rules::isort::categorize" log.file="crates\\ruff_linter\\src\\rules\\isort\\categorize.rs" log.line=149
2025-10-14 14:11:04.335352600 DEBUG request{id=11 method="shutdown"}: enter
2025-10-14 14:11:04.335418100 DEBUG request{id=11 method="shutdown"}: Received shutdown request, waiting for shutdown notification
2025-10-14 14:11:04.336288800 DEBUG Received exit notification, exiting
2025-10-14 14:11:04.338179400 INFO Server shut down
Weird thing is that there are multiple .py files in the same folder as the file that is having issues. So they have the same path.
The path of the file having problems is:
"C:\Users\mweehuizen\viktor-apps\libbase\src\libbase\gef_folder\plot_helper_functions.py"
the path to a file having no issues is:
"C:\Users\mweehuizen\viktor-apps\libbase\src\libbase\gef_folder\visualisations.py"
(Or any othe file in the project)
When I clone the project again from gitlab. The issue is gone for this file. So something in this file is weird/corrupt... Might be related to WSL.
I found these issues with the same problem:
https://github.com/astral-sh/ruff-vscode/issues/713 https://github.com/astral-sh/ruff-vscode/issues/840
I now have both projects. The original with the broken file and the new one where everything works as expected. If you want me to run some tests to find the rott cause of this. Let me know.
https://github.com/astral-sh/ruff-vscode/issues/713
Ah, that's the issue I was thinking of
I'm not sure what Ruff should do here. The file URLs are supposed to be opaque identifiers that are controlled by the client. We could consider normalizing URLs but this comes at the risk that we normalize two paths that are supposed to be different to be the same. We could restrict this to only do this when resolving settings... but I'm not entirely sure what the normalization should even be.
I'd have to do some research to see if there's a corresponding upstream VS Code issue
Okay, I think this is https://github.com/microsoft/language-server-protocol/pull/1786