From: Eric Biggers Date: Sat, 22 Jul 2023 23:33:08 +0000 (-0700) Subject: Add a clang-format file X-Git-Tag: v1.14.2~1 X-Git-Url: https://wimlib.net/git/?a=commitdiff_plain;h=e64e8de72590d1e5cad985a47d9544b036905f2c;p=wimlib Add a clang-format file 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. --- diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..069b7eb3 --- /dev/null +++ b/.clang-format @@ -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