From 3cb1a8faed7cea5e24085ada4db6940906d48e6b Mon Sep 17 00:00:00 2001 From: Avasam Date: Thu, 19 Oct 2023 03:34:40 -0400 Subject: [PATCH] Configure editors to explicitly use `LF` / `\n` line endings (#10916) --- .editorconfig | 10 ++++++---- .gitattributes | 3 +++ .vscode/settings.default.json | 3 ++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.editorconfig b/.editorconfig index 5394de3d7..49b78217f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,12 +1,14 @@ root = true -[*.{py,pyi,rst,md,yml,yaml,toml,json,txt}] +[*] trim_trailing_whitespace = true insert_final_newline = true indent_style = space +end_of_line = lf +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false [*.{py,pyi,toml,json}] indent_size = 4 - -[*.{yml,yaml}] -indent_size = 2 diff --git a/.gitattributes b/.gitattributes index 205396b4e..17a1d7ab9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,6 @@ +# Normalize EOF +* autocrlf=false +* eol=lf # Set linguist-language to support comments syntax highlight **/stubtest_allowlist*.txt linguist-language=ini tests/stubtest_allowlists/*.txt linguist-language=ini diff --git a/.vscode/settings.default.json b/.vscode/settings.default.json index 32bbd68a3..6f0b0630e 100644 --- a/.vscode/settings.default.json +++ b/.vscode/settings.default.json @@ -24,6 +24,7 @@ "**/.*_cache": true, // mypy and Ruff cache "**/__pycache__": true }, + "files.eol": "\n", "files.insertFinalNewline": true, "files.trimFinalNewlines": true, "files.trimTrailingWhitespace": true, @@ -31,7 +32,7 @@ "editor.insertSpaces": true, "editor.detectIndentation": false, "editor.tabSize": 2, - "[json][jsonc][python]": { + "[json][jsonc][python][toml]": { "editor.tabSize": 4 }, "editor.rulers": [