From 24d0a7ec3992c6ca0f8f2a045b5585708b965c09 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 1 Mar 2021 17:52:52 +0100 Subject: [PATCH] Add `.editorconfig` and `.gitattributes` files for automatic settings (#4700) This smoothens the contribtor experience by automatically configuring editors that support EditorConfig. The `.gitattributes` file ensures that all files use LF line endings when committed to Git. --- .editorconfig | 19 +++++++++++++++++++ .gitattributes | 3 +++ 2 files changed, 22 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..7614d1b1b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = space +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true + +# YAML requires indentation with spaces instead of tabs. +[*.{js,yml,yaml}] +indent_style = space +indent_size = 2 + +# Makefile requires tab indentation. +[Makefile] +indent_style = tab +indent_size = 4 diff --git a/.gitattributes b/.gitattributes index 4631c3bd3..bd70af630 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,5 @@ # Properly detect languages on GitHub *.rst linguist-detectable=true + +# Normalize EOL for all files that Git considers text files +* text=auto eol=lf