From 0d68c454a58b83abe85af8caa792e751c23b3683 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Thu, 27 Jan 2022 16:28:43 +0000 Subject: [PATCH 1/4] Add .editorconfig * The settings are for all file types, we might have some exceptions, i.e. .xml files. * This is based on what we've been doing all along. Only the max line length has previously been codified in, e.g. pyproject.toml. We've not even codified things like "4-space indentations, expanded from TABs" in Contributing.md. --- .editorconfig | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..7dcb0a42 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,21 @@ +# This is the project top-level .editorconfig +root = true + +# Defaults for all file types +[*] +# 4-space indents, no TABs +indent_style = space +tab_width = 4 +indent_size = tab + +# Hard-wrap at 120 columns +max_line_length = 119 + +# Unix EOL +end_of_line = lf + +# UTF-8 is the only sensible option, no BOM +charset = utf-8 + +# All files should have a final newline +insert_final_newline = true From f36d45d4bc70062b89545de5ac47e29146b50f64 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Thu, 27 Jan 2022 16:36:41 +0000 Subject: [PATCH 2/4] Contributing: Add section on text formatting / .editorconfig --- Contributing.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Contributing.md b/Contributing.md index 0b1f4d58..e61fe764 100644 --- a/Contributing.md +++ b/Contributing.md @@ -23,6 +23,16 @@ consistent with our vision for EDMC. Fundamental changes in particular need to b --- +## Text formatting + +The project contains an `.editorconfig` file at its root. Please either ensure +your editor is taking note of those settings, or cross-check its contents +with the +[editorconfig documentation](https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties) +, and ensure your editor/IDE's settings match. + +--- + ## General workflow 1. You will need a GitHub account. From cdba879369c3b3818aff1cd05671016439a5fc88 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Thu, 27 Jan 2022 16:37:20 +0000 Subject: [PATCH 3/4] .editorconfig: Actually, we use crlf, with git converting --- .editorconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 7dcb0a42..9f588ce0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,7 +12,7 @@ indent_size = tab max_line_length = 119 # Unix EOL -end_of_line = lf +end_of_line = crlf # UTF-8 is the only sensible option, no BOM charset = utf-8 From 32f98ea6dee5bbc0762e2c115083e390046b4c2b Mon Sep 17 00:00:00 2001 From: Athanasius Date: Thu, 27 Jan 2022 17:01:49 +0000 Subject: [PATCH 4/4] .editorconfig: Fix the EOL comment --- .editorconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 9f588ce0..adbf367f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,7 +11,7 @@ indent_size = tab # Hard-wrap at 120 columns max_line_length = 119 -# Unix EOL +# Windows EOL, for historical reasons end_of_line = crlf # UTF-8 is the only sensible option, no BOM