astral-sh / ruff-vscode

A Visual Studio Code extension with support for the Ruff linter.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ruff activation on Dev Container Environments

marcraminv opened this issue · comments

Setup information

  • Remote Development extension pack
  • Macbook M1
  • Ruff 0.2.0 vscode extension

.devcontainer.json config

{
    "image": "python:3.11.8",
    "name": "python-environment",
    "runArgs": ["--name=python-dev-environment", "--rm"],
    "features": {
        "ghcr.io/devcontainers/features/common-utils:2": {}
    },
    "customizations": {
        "vscode": {
            "extensions": [
                "ms-python.python", 
                "ms-toolsai.jupyter", 
                "equinusocio.vsc-material-theme-icons", 
                "charliermarsh.ruff"
            ]
        }
    },
}
SCR-20240218-pksd

My guess is Ruff doesn't detect Python extension on the first build. The user need to restart the window to make Ruff aware of Python extension installed on the container.

Do you see the same behavior if you use one of the Microsoft-published extensions, like Black or isort? If so, this may be an issue for Microsoft's extension template.

I try it and back to you if the issue is different.