From 54e0e49c5b393faf47f0efea07d7a3aa51da67fe Mon Sep 17 00:00:00 2001 From: Josh Bradley Date: Wed, 10 Jul 2024 04:26:05 -0400 Subject: [PATCH] Improve file normalization (LF vs CRLF) enforcement and devcontainer mount paths (#60) --- .devcontainer/devcontainer.json | 6 ++++-- .editorconfig | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .editorconfig diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d8320c2..03ed2b5 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -22,13 +22,15 @@ "PYTHONPATH": "/graphrag-accelerator/backend/:$PATH" }, "mounts": [ + // NOTE: we reference both HOME and USERPROFILE environment variables to simultaneously support both Windows and Unix environments + // in most default situations, only one variable will exist (Windows has USERPROFILE and unix has HOME) and a reference to the other variable will result in an empty string // Keep command history "type=volume,source=graphrag-bashhistory,target=/home/vscode/command_history", "type=volume,source=graphrag-devcontainer-vscode-server,target=/home/vscode/.vscode-server/extensions", // Mounts the login details from the host machine so azcli works seamlessly in the container - // "type=bind,source=${localEnv:HOME}/.azure,target=/home/vscode/.azure", + // "type=bind,source=${localEnv:HOME}${localEnv:USERPROFILE}/.azure,target=/home/vscode/.azure", // Mounts the ssh details from the host machine - this allows the container to connect to ssh hosts - "type=bind,source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh", + "type=bind,source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/home/vscode/.ssh", // Mount docker socket for docker builds "type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock" ], diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..0b3779e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,5 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true