]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - .clang-format
docs: document new description field
[thirdparty/systemd.git] / .clang-format
index ef7c918d4e73f47434cdcb75911b01d78fdfdbee..ab27960a6738f78f76790049bea97b6dead1b055 100644 (file)
@@ -3,10 +3,24 @@
 # result MUST NOT be committed indiscriminately, but each automated
 # change should be reviewed and only the appropriate ones commited.
 #
-# To apply the coding style you can run the following command (assuming you
-# installed clang-format on your system):
+# The easiest way to apply the formatting to your changes ONLY,
+# is to use the git-clang-format script (usually installed with clang-format).
 #
+# -  Fix up formatting before committing
+# 1. Edit and stage your files.
+# 2. Run `git clang-format`.
+# 3. Verify + correct + (un)stage changes.
+# 4. Commit.
+#
+# -  Fix up formatting after committing
+# 1. Commit your changes.
+# 2. Run `git clang-format HEAD~` - Refer the commit *before* your changes here.
+# 3. Verify + correct changes, `git difftool -d` can help here.
+# 4. Stage + commit, potentially with `--amend` (means to fixup the last commit).
+#
+# To run clang-format on all sourcefiles, use the following line:
 # $ git ls-files 'src/*.[ch]' 'src/*.cc' | xargs clang-format -i -style=file
+#
 # You can find more information on the different config parameters in this file here:
 # https://clang.llvm.org/docs/ClangFormatStyleOptions.html
 ---
@@ -20,7 +34,7 @@ AlwaysBreakTemplateDeclarations: Yes
 BinPackArguments: false
 BinPackParameters: false
 BraceWrapping:
-  AfterEnum:       true
+  AfterEnum:       false
   SplitEmptyFunction: false
   SplitEmptyRecord: false
   SplitEmptyNamespace: false