astral-sh / ruff-vscode

A Visual Studio Code extension with support for the Ruff linter.
Other
1.06k stars 53 forks source link

Ruff activation on Dev Container Environments #409

Closed marcraminv closed 6 months ago

marcraminv commented 7 months ago

Setup information

.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.

charliermarsh commented 6 months ago

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.

marcraminv commented 6 months ago

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