From d7294fa887f94e2806ae0c76fff7deee43127a78 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Mon, 6 Jan 2025 17:30:47 -0600 Subject: [PATCH] VSCode Tweaks (#914) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Pull Request ## Title Revert back to black VSCode extension. --- ## Description The pre-commit extension has issues in DevContainer environments where pre-commit is not installed on the host. This PR reverts to the VSCode black formatting extension for interactive formatting and adds some additional attempts to make the isort equivalent that'd we'd otherwise get out of pre-commit to happen as well. Note that these will be best effort for now. pre-commit formatting rules will still be authoritative. --- ## Type of Change - 🛠️ Bug fix --- ## Testing Local edits. --- ## Additional Notes (optional) No guarantee that this is perfect unfortunately. --- --- .devcontainer/devcontainer.json | 2 +- .vscode/extensions.json | 2 +- .vscode/settings.json | 21 +++++++++++++++++---- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1e913a5fa8..91373d000a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -70,7 +70,7 @@ "lextudio.restructuredtext", "matangover.mypy", "ms-azuretools.vscode-docker", - "elagil.pre-commit-helper", + "ms-python.black-formatter", "ms-python.pylint", "ms-python.python", "ms-python.vscode-pylance", diff --git a/.vscode/extensions.json b/.vscode/extensions.json index ca8fbb4764..92725b501c 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -14,7 +14,7 @@ "lextudio.restructuredtext", "matangover.mypy", "ms-azuretools.vscode-docker", - "elagil.pre-commit-helper", + "ms-python.black-formatter", "ms-python.pylint", "ms-python.python", "ms-python.vscode-pylance", diff --git a/.vscode/settings.json b/.vscode/settings.json index 5ace63e513..ea13eafa66 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -139,11 +139,24 @@ ], "esbonio.sphinx.confDir": "${workspaceFolder}/doc/source/", "esbonio.sphinx.buildDir": "${workspaceFolder}/doc/build/", - "pre-commit-helper.excludedHookIds": [ - "mypy", - "pylint" + "editor.rulers": [ + // editorconfig default + 132 ], - "pre-commit-helper.runOnSave": "fixes", + "isort.check": true, + "[python]": { + "editor.codeActionsOnSave": { + "source.organizeImports": "explicit", + "source.unusedImports": "explicit" + }, + "editor.defaultFormatter": "ms-python.black-formatter", + "editor.formatOnSave": true, + "editor.formatOnSaveMode": "modifications", + "editor.rulers": [ + // python code formatting limit + 99 + ] + }, "pylint.severity": { // display refactor warnings as information messages "refactor": "Information"