]> wimlib.net Git - wimlib/commitdiff
Add a clang-format file
authorEric Biggers <ebiggers3@gmail.com>
Sat, 22 Jul 2023 23:33:08 +0000 (16:33 -0700)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 23 Jul 2023 00:03:36 +0000 (17:03 -0700)
This approximates the de facto coding style of this project, which is
quite similar to the Linux kernel coding style.

This is just in case people to use it with 'git clang-format', as
requested at https://wimlib.net/forums/viewtopic.php?t=666.  I'm not
planning to reformat all the existing code to make it match exactly.

.clang-format [new file with mode: 0644]

diff --git a/.clang-format b/.clang-format
new file mode 100644 (file)
index 0000000..069b7eb
--- /dev/null
@@ -0,0 +1,34 @@
+BasedOnStyle: LLVM
+AllowShortFunctionsOnASingleLine: false
+AllowShortIfStatementsOnASingleLine: false
+AlignConsecutiveMacros: Consecutive
+AlwaysBreakAfterReturnType: All
+BreakBeforeBraces: Linux
+Cpp11BracedListStyle: false
+ForEachMacros:
+  - 'avl_tree_for_each_in_order'
+  - 'avl_tree_for_each_in_postorder'
+  - 'avl_tree_for_each_in_reverse_order'
+  - 'dentry_for_each_ci_match'
+  - 'for_dentry_child'
+  - 'for_dentry_child_postorder'
+  - 'for_inode_child'
+  - 'for_inode_child_postorder'
+  - 'hlist_for_each_entry'
+  - 'hlist_for_each_entry_safe'
+  - 'image_for_each_inode'
+  - 'image_for_each_inode_safe'
+  - 'image_for_each_unhashed_blob'
+  - 'image_for_each_unhashed_blob_safe'
+  - 'inode_for_each_dentry'
+  - 'inode_for_each_extraction_alias'
+  - 'list_for_each'
+  - 'list_for_each_entry'
+  - 'list_for_each_entry_reverse'
+  - 'list_for_each_entry_safe'
+  - 'xml_node_for_each_child'
+IncludeBlocks: Preserve
+IndentCaseLabels: false
+IndentWidth: 8
+SpaceBeforeParens: ControlStatementsExceptControlMacros
+UseTab: Always