From ae3164e226320ea8082b8257f0c67b43c1db56d2 Mon Sep 17 00:00:00 2001
From: Vasili Novikov <vasya.novikov+cm3513git@gmail.com>
Date: Fri, 22 Jan 2021 09:51:23 +0100
Subject: [PATCH] Add .editorconfig

Editorconfig is a lightweight specification that
helps maintaining consistent coding/formatting style
accross editors, especially those editors
that are not explicitly aware of Rust and rustfmt.

https://editorconfig.org/
---
 .editorconfig                  | 21 +++++++++++++++++++++
 src/tools/clippy/.editorconfig |  2 ++
 2 files changed, 23 insertions(+)
 create mode 100644 .editorconfig

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000000000..ec6e107d547f0
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,21 @@
+# EditorConfig helps developers define and maintain consistent
+# coding styles between different editors and IDEs
+# editorconfig.org
+
+root = true
+
+[*]
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+indent_style = space
+indent_size = 4
+
+[*.md]
+# double whitespace at end of line
+# denotes a line break in Markdown
+trim_trailing_whitespace = false
+
+[*.yml]
+indent_size = 2
diff --git a/src/tools/clippy/.editorconfig b/src/tools/clippy/.editorconfig
index a13173544d80a..ec6e107d547f0 100644
--- a/src/tools/clippy/.editorconfig
+++ b/src/tools/clippy/.editorconfig
@@ -13,6 +13,8 @@ indent_style = space
 indent_size = 4
 
 [*.md]
+# double whitespace at end of line
+# denotes a line break in Markdown
 trim_trailing_whitespace = false
 
 [*.yml]