vscode-remote-release
vscode-remote-release copied to clipboard
Claims that black is invalid as a formatter
The dev container linter claims that "ms-python.black-formatter" is invalid as a value. I believe it's valid, however. (It seems to work)
Version: 1.77.3 Commit: 704ed70d4fd1c6bd6342c436f1ede30d1cff4710 User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.58 Embedder: codespaces
Full devcontainer.json:
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/python-3
{
"name": "Python 3",
"forwardPorts": [8000],
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local on arm64/Apple Silicon.
"VARIANT": "3.11-bullseye"
}
},
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.linting.enabled": true,
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.formatting.provider": "black",
"files.exclude": {
"**/*.coverage": true,
".ruff_cache": true,
".pytest_cache": true
}
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"charliermarsh.ruff",
"ms-python.black-formatter"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pip3 install --user -r requirements-dev.txt && pre-commit install",
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
This should likely be filed on the dev container extension (I will move it to the correct repo). The extension registers a formatter on activate using registerDocumentFormattingEditProvider.
I also see this when editing .vscode/settings.json, so not sure that it should only be a dev container issue?
/cc @chrmarti
Having the same issue. I'm not running a dev container just plain vscode.
I am having a similar issue with yapf but via SSH Remote. Black doesn't throw an error but just doesn't do anything. Yapf throws an error:
Yapf works fine locally on my Mac, but when I install on the remote, it throws an error:
Extension 'yapf' is configured as formatter but it cannot format 'Python'-files