From e64e8de72590d1e5cad985a47d9544b036905f2c Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 22 Jul 2023 16:33:08 -0700 Subject: [PATCH] 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. --- .clang-format | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .clang-format 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 -- 2.43.0