summaryrefslogtreecommitdiff
path: root/.editorconfig
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2018-10-08 22:03:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-10-09 09:33:57 (GMT)
commit6f9beef335de5baff72e146a8af9754973d598e4 (patch)
tree3804abcbdcc91fe4dd9a5f0459314cc7f7973521 /.editorconfig
parentcae598d9980661a978e2df4fb338518f7bf09572 (diff)
downloadgit-6f9beef335de5baff72e146a8af9754973d598e4.zip
git-6f9beef335de5baff72e146a8af9754973d598e4.tar.gz
git-6f9beef335de5baff72e146a8af9754973d598e4.tar.bz2
editorconfig: provide editor settings for Git developers
Contributors to Git use a variety of editors, each with their own configuration files. Because C lacks the defined norms on how to indent and style code that other languages, such as Ruby and Rust, have, it's possible for various contributors, especially new ones, to have configured their editor to use a style other than the style the Git community prefers. To make automatically configuring one's editor easier, provide an EditorConfig file. This is an INI-style configuration file that can be used to specify editor settings and can be understood by a wide variety of editors. Some editors include this support natively; others require a plugin. Regardless, providing such a file allows users to automatically configure their editor of choice with the correct settings by default. Provide global settings to set the character set to UTF-8 and insert a final newline into files. Provide language-specific settings for C, Shell, Perl, and Python files according to what CodingGuidelines already specifies. Since the indentation of other files varies, especially certain AsciiDoc files, don't provide any settings for them until a clear consensus forward emerges. Set the line length for commit messages to 72 characters, which is the generally accepted line length for emails, since we send patches by email. Don't specify an end of line type. While the Git community uses Unix-style line endings in the repository, some Windows users may use Git's auto-conversion support and forcing Unix-style line endings might cause problems for those users. Finally, leave out a root directive, which would prevent reading other EditorConfig files higher up in the tree, in case someone wants to set the end of line type for their system in such a file. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Reviewed-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '.editorconfig')
-rw-r--r--.editorconfig14
1 files changed, 14 insertions, 0 deletions
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..8667740
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,14 @@
+[*]
+charset = utf-8
+insert_final_newline = true
+
+[*.{c,h,sh,perl,pl,pm}]
+indent_style = tab
+tab_width = 8
+
+[*.py]
+indent_style = space
+indent_size = 4
+
+[COMMIT_EDITMSG]
+max_line_length = 72