From 692187c1abb286a726d3244978b943480789d03a Mon Sep 17 00:00:00 2001 From: Will Cromar Date: Fri, 17 May 2024 18:11:42 +0000 Subject: [PATCH] fix formatting settings --- .devcontainer/tpu-internal/devcontainer.json | 6 +++--- CONTRIBUTING.md | 2 ++ contrib/vscode/settings.json | 18 ++++++++++++++---- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.devcontainer/tpu-internal/devcontainer.json b/.devcontainer/tpu-internal/devcontainer.json index 4358bd5612f..a0684c8f90f 100644 --- a/.devcontainer/tpu-internal/devcontainer.json +++ b/.devcontainer/tpu-internal/devcontainer.json @@ -17,14 +17,14 @@ "llvm-vs-code-extensions.vscode-clangd", "ms-vscode.cpptools-themes", "BazelBuild.vscode-bazel", - "DevonDCarew.bazel-code", "StackBuild.bazel-stack-vscode", "StackBuild.bazel-stack-vscode-cc", "xaver.clang-format", "ryanluker.vscode-coverage-gutters", "ms-azuretools.vscode-docker", - "ms-python.python" + "ms-python.python", + "eeyore.yapf" ] } } -} \ No newline at end of file +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a315f267d32..98bafcb94fa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,6 +25,8 @@ We recommend you to use our prebuilt Docker image to start your development work ```bash ln -s pytorch/xla/.devcontainer/ .devcontainer ln -s pytorch/xla/contrib/vscode/ .vscode + ln -s pytorch/xla/.style.yapf .style.yapf + ln -s pytorch/xla/.clang-format .clang-format ``` * From VSCode's command menu, run `Reopen in Container` to open your workspace in one of our pre-built Docker containers. Select the correct container config based on your local accelerator (default to `tpu-contributor` if you are not sure). diff --git a/contrib/vscode/settings.json b/contrib/vscode/settings.json index 59b86e622e7..b09fba227e6 100644 --- a/contrib/vscode/settings.json +++ b/contrib/vscode/settings.json @@ -14,9 +14,19 @@ "coverage-gutters.coverageFileNames": [ "./bazel-out/_coverage/_coverage_report.dat" ], - "lcov.path": [ - "./bazel-out/_coverage/_coverage_report.dat" + "git.detectSubmodules": false, + "[python]": { + "editor.defaultFormatter": "eeyore.yapf", + "editor.formatOnSave": true, + }, + "python.analysis.exclude": [ + "**/third_party", + "**/build", + "**/__pycache__", + "**/.git", ], - "python.formatting.provider": "yapf", - "editor.formatOnSave": true + "[cpp]": { + "editor.defaultFormatter": "xaver.clang-format", + "editor.formatOnSave": true, + } }