{"thread":{"id":"49512","subject":"[PATCH v3 0/2] EditorConfig file","startedAt":"2018-10-08T22:04:03Z","lastAt":"2018-10-08T22:21:22Z","messageCount":4,"participants":["brian m. carlson","Taylor Blau"],"isPatch":true,"patchVersion":3,"patchTotal":2},"messages":[{"id":"359871","messageId":"20181008220353.780301-1-sandals@crustytoothpaste.net","threadId":"49512","inReplyTo":null,"subject":"[PATCH v3 0/2] EditorConfig file","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-10-08T22:03:51Z","receivedAt":"2018-10-08T22:04:03Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"This series introduces an EditorConfig file to help developers using any\neditor set their editor's settings in conformance with the Git Project's\nsettings.  This is helpful for developers who work on different projects\nwith different indentation standards to keep their work in sync.\n\nChanges since v2:\n* Add .pl and .pm files.\n\nChanges since v1:\n* Add notes to both .editorconfig and .clang-format that they should be\n  kept in sync.\n* Add commit message line length.\n\nbrian m. carlson (2):\n  editorconfig: provide editor settings for Git developers\n  editorconfig: indicate settings should be kept in sync\n\n .clang-format |  2 ++\n .editorconfig | 16 ++++++++++++++++\n 2 files changed, 18 insertions(+)\n create mode 100644 .editorconfig\n\n"},{"id":"359872","messageId":"20181008220353.780301-2-sandals@crustytoothpaste.net","threadId":"49512","inReplyTo":"20181008220353.780301-1-sandals@crustytoothpaste.net","subject":"[PATCH v3 1/2] editorconfig: provide editor settings for Git developers","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-10-08T22:03:52Z","receivedAt":"2018-10-08T22:04:04Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Contributors to Git use a variety of editors, each with their own\nconfiguration files.  Because C lacks the defined norms on how to indent\nand style code that other languages, such as Ruby and Rust, have, it's\npossible for various contributors, especially new ones, to have\nconfigured their editor to use a style other than the style the Git\ncommunity prefers.\n\nTo make automatically configuring one's editor easier, provide an\nEditorConfig file.  This is an INI-style configuration file that can be\nused to specify editor settings and can be understood by a wide variety\nof editors.  Some editors include this support natively; others require\na plugin.  Regardless, providing such a file allows users to\nautomatically configure their editor of choice with the correct settings\nby default.\n\nProvide global settings to set the character set to UTF-8 and insert a\nfinal newline into files.  Provide language-specific settings for C,\nShell, Perl, and Python files according to what CodingGuidelines already\nspecifies.  Since the indentation of other files varies, especially\ncertain AsciiDoc files, don't provide any settings for them until a\nclear consensus forward emerges.\n\nSet the line length for commit messages to 72 characters, which is the\ngenerally accepted line length for emails, since we send patches by\nemail.\n\nDon't specify an end of line type.  While the Git community uses\nUnix-style line endings in the repository, some Windows users may use\nGit's auto-conversion support and forcing Unix-style line endings might\ncause problems for those users.\n\nFinally, leave out a root directive, which would prevent reading other\nEditorConfig files higher up in the tree, in case someone wants to set\nthe end of line type for their system in such a file.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n .editorconfig | 14 ++++++++++++++\n 1 file changed, 14 insertions(+)\n create mode 100644 .editorconfig\n\ndiff --git a/.editorconfig b/.editorconfig\nnew file mode 100644\nindex 0000000000..8667740e1d\n--- /dev/null\n+++ b/.editorconfig\n@@ -0,0 +1,14 @@\n+[*]\n+charset = utf-8\n+insert_final_newline = true\n+\n+[*.{c,h,sh,perl,pl,pm}]\n+indent_style = tab\n+tab_width = 8\n+\n+[*.py]\n+indent_style = space\n+indent_size = 4\n+\n+[COMMIT_EDITMSG]\n+max_line_length = 72\n"},{"id":"359873","messageId":"20181008220353.780301-3-sandals@crustytoothpaste.net","threadId":"49512","inReplyTo":"20181008220353.780301-1-sandals@crustytoothpaste.net","subject":"[PATCH v3 2/2] editorconfig: indicate settings should be kept in sync","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-10-08T22:03:53Z","receivedAt":"2018-10-08T22:04:05Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Now that we have two places where we set code formatting settings,\n.editorconfig and .clang-format, it's possible that they could fall out\nof sync.  This is relatively unlikely, since we're not likely to change\nthe tab width or our preference for tabs, but just in case, add comments\nto both files reminding future developers to keep them in sync.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n .clang-format | 2 ++\n .editorconfig | 2 ++\n 2 files changed, 4 insertions(+)\n\ndiff --git a/.clang-format b/.clang-format\nindex 12a89f95f9..de1c8b5c77 100644\n--- a/.clang-format\n+++ b/.clang-format\n@@ -6,6 +6,8 @@\n \n # Use tabs whenever we need to fill whitespace that spans at least from one tab\n # stop to the next one.\n+#\n+# These settings are mirrored in .editorconfig.  Keep them in sync.\n UseTab: Always\n TabWidth: 8\n IndentWidth: 8\ndiff --git a/.editorconfig b/.editorconfig\nindex 8667740e1d..42cdc4bbfb 100644\n--- a/.editorconfig\n+++ b/.editorconfig\n@@ -2,6 +2,8 @@\n charset = utf-8\n insert_final_newline = true\n \n+# The settings for C (*.c and *.h) files are mirrored in .clang-format.  Keep\n+# them in sync.\n [*.{c,h,sh,perl,pl,pm}]\n indent_style = tab\n tab_width = 8\n"},{"id":"359875","messageId":"20181008222118.GA26078@syl","threadId":"49512","inReplyTo":"20181008220353.780301-1-sandals@crustytoothpaste.net","subject":"Re: [PATCH v3 0/2] EditorConfig file","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2018-10-08T22:21:18Z","receivedAt":"2018-10-08T22:21:22Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Mon, Oct 08, 2018 at 10:03:51PM +0000, brian m. carlson wrote:\n> This series introduces an EditorConfig file to help developers using any\n> editor set their editor's settings in conformance with the Git Project's\n> settings.  This is helpful for developers who work on different projects\n> with different indentation standards to keep their work in sync.\n>\n> Changes since v2:\n> * Add .pl and .pm files.\n>\n> Changes since v1:\n> * Add notes to both .editorconfig and .clang-format that they should be\n>   kept in sync.\n> * Add commit message line length.\n\nThanks for both of these. I think that v3 is ready for queueing, if\nother folks find it OK to have an .editorconfig in the repository.\n\nTherefore:\n\n  Reviewed-by: Taylor Blau <me@ttaylorr.com>\n\nThanks,\nTaylor\n"}]}