git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 2/2] editorconfig: indicate settings should be kept in sync

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Oct 8, 2018, 20:29 UTC
Message-ID
<20181008202903.100166-3-sandals@crustytoothpaste.net>
In-Reply-To
<20181008202903.100166-1-sandals@crustytoothpaste.net>

Now that we have two places where we set code formatting settings, .editorconfig and .clang-format, it's possible that they could fall out of sync. This is relatively unlikely, since we're not likely to change the tab width or our preference for tabs, but just in case, add comments to both files reminding future developers to keep them in sync.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
---
 .clang-format | 2 ++
 .editorconfig | 2 ++
 2 files changed, 4 insertions(+)
diff --git a/.clang-format b/.clang-format
index 12a89f95f9..de1c8b5c77 100644
--- a/.clang-format
+++ b/.clang-format
@@ -6,6 +6,8 @@
 
 # Use tabs whenever we need to fill whitespace that spans at least from one tab
 # stop to the next one.
+#
+# These settings are mirrored in .editorconfig.  Keep them in sync.
 UseTab: Always
 TabWidth: 8
 IndentWidth: 8
diff --git a/.editorconfig b/.editorconfig
index 83227fa0b2..98d7c5ff99 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -2,6 +2,8 @@
 charset = utf-8
 insert_final_newline = true
 
+# The settings for C (*.c and *.h) files are mirrored in .clang-format.  Keep
+# them in sync.
 [*.{c,h,sh,perl}]
 indent_style = tab
 tab_width = 8
Previous: brian m. carlsonNext: brian m. carlson
Message 2 of 5 in “EditorConfig file”
  1. 0/2 EditorConfig filebrian m. carlson, Oct 8, 2018
  2. 2/2 editorconfig: indicate settings should be kept in syncbrian m. carlson, Oct 8, 2018
  3. 1/2 editorconfig: provide editor settings for Git developersbrian m. carlson, Oct 8, 2018
  4. Ævar Arnfjörð BjarmasonOct 8, 2018
  5. brian m. carlsonOct 8, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.