- A minimal code snippet that reproduces the bug.
Create test.ipynb, create a cell with
from abc import (a, b, c
)
Perform Format Select/Cell/Document/Notebook via ctrl+shift+P, the right click menu or the keyboard shortcuts.
No changes observed in the cell.
Ruff output:
2024-09-04 11:28:50.174 [info] Using interpreter executable: /home/jamesvrt/miniconda3/envs/test/bin/ruff
2024-09-04 11:28:50.174 [info] Found ruff 0.6.4 at /home/jamesvrt/miniconda3/envs/test/bin/ruff
2024-09-04 11:28:50.174 [info] Running Ruff with: /home/jamesvrt/miniconda3/envs/test/bin/ruff ['format', '--force-exclude', '--quiet', '--stdin-filename', '/home/jamesvrt/test/test.ipynb', '--config', 'line-length=120']
Performing ruff format test.ipynb on the CLI works as expected.
Including "ruff.nativeServer": "on" in settings.json resolves the issue.
- The current Ruff and VS Code settings (any relevant sections from your
pyproject.toml and settings.json).
No ruff.toml or pyproject.toml
settings.json includes:
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
},
"ruff.format.args": ["--config", "line-length=120"],
"notebook.defaultFormatter": "charliermarsh.ruff",
- The current Ruff and VS Code extension versions (
ruff --version).
ruff 0.6.3
ruff vscode extension 2024.42.0
- A description of your environment (e.g., operating system, Python version, etc.).
Ubuntu 22.04
VSCode 1.92.2
Python 3.10.11
Create
test.ipynb, create a cell withPerform Format Select/Cell/Document/Notebook via ctrl+shift+P, the right click menu or the keyboard shortcuts.
No changes observed in the cell.
Ruff output:
Performing
ruff format test.ipynbon the CLI works as expected.Including
"ruff.nativeServer": "on"insettings.jsonresolves the issue.pyproject.tomlandsettings.json).No
ruff.tomlorpyproject.tomlsettings.jsonincludes:ruff --version).ruff 0.6.3
ruff vscode extension 2024.42.0
Ubuntu 22.04
VSCode 1.92.2
Python 3.10.11