From 6294c3b913d1f36b92f3c3845c4101644343e95e Mon Sep 17 00:00:00 2001 From: orland0m Date: Sun, 30 Jun 2024 16:06:59 -0700 Subject: [PATCH] Enable devcontainer linters (#7019) --- .devcontainer/devcontainer.json | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4596b59200..8d9565ad5f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,7 +1,9 @@ { "name": "ESPHome Dev", "image": "ghcr.io/esphome/esphome-lint:dev", - "postCreateCommand": ["script/devcontainer-post-create"], + "postCreateCommand": [ + "script/devcontainer-post-create" + ], "containerEnv": { "DEVCONTAINER": "1", "PIP_BREAK_SYSTEM_PACKAGES": "1", @@ -27,6 +29,9 @@ "extensions": [ // python "ms-python.python", + "ms-python.pylint", + "ms-python.flake8", + "ms-python.black-formatter", "visualstudioexptteam.vscodeintellicode", // yaml "redhat.vscode-yaml", @@ -38,9 +43,21 @@ "settings": { "python.languageServer": "Pylance", "python.pythonPath": "/usr/bin/python3", - "python.linting.pylintEnabled": true, - "python.linting.enabled": true, - "python.formatting.provider": "black", + "pylint.args": [ + "--rcfile=${workspaceFolder}/pyproject.toml" + ], + "flake8.args": [ + "--config=${workspaceFolder}/.flake8" + ], + "black-formatter.args": [ + "--config", + "${workspaceFolder}/pyproject.toml" + ], + "[python]": { + // VS will say "Value is not accepted" before building the devcontainer, but the warning + // should go away after build is completed. + "editor.defaultFormatter": "ms-python.black-formatter" + }, "editor.formatOnPaste": false, "editor.formatOnSave": true, "editor.formatOnType": true,