[PATCH v2] Add a comment to .clang-format about the meaning of the file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Having a .clang-format file in a project can be understood in a way that code
has to be in the style defined by the .clang-format file, i.e., you just have
to run clang-format over all code and you are set. This is not the case in the
Git project, which is now reflected by a comment in the beginning of the file.

Additionally, the working clang-format version is mentioned because the config
directives change from time to time (in a compatibility-breaking way).

Signed-off-by: Stephan Beyer <s-beyer@xxxxxxx>
---

Notes:
    On 10/01/2017 04:45 AM, Junio C Hamano wrote:
    > it makes as if a random patch to "make it
    > conform" without thinking if the rules make sense were a welcome
    > addition, which is absolutely the last signal we would want to send
    > to the readers.
    
    Right. I dropped that last sentence and replaced it by a sentence about human
    aesthetics judgement overruling mechanical rules -- I think that's somehow quoted
    from a comment of yours on the list.

 .clang-format | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/.clang-format b/.clang-format
index 3ede2628d..041b7be03 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,4 +1,8 @@
-# Defaults
+# This file is an example configuration for clang-format 5.0.
+#
+# Note that this style definition should only be understood as a hint
+# for writing new code. In the end, human aesthetics judgement overrules
+# mechanical rules.
 
 # Use tabs whenever we need to fill whitespace that spans at least from one tab
 # stop to the next one.
-- 
2.14.2.677.g5a59ab275




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux