aboutsummaryrefslogtreecommitdiff
path: root/.clang-format
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2025-09-12 12:31:51 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2025-09-12 12:31:51 +0300
commit3620253a9463a9a256a2a031312d175fd23c73c1 (patch)
tree6481bcaacc3ace65bf61686eaf2686153237834f /.clang-format
parentac22f535bcd14f8e201d410265aab268899d7753 (diff)
downloadc-wares-master.tar.gz
c-wares-master.zip
utest: add benchmarksHEADmaster
Also updated clang-format a bit.
Diffstat (limited to '.clang-format')
-rw-r--r--.clang-format200
1 files changed, 42 insertions, 158 deletions
diff --git a/.clang-format b/.clang-format
index 008800f..d78aa7a 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,187 +1,71 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# clang-format configuration file. Intended for clang-format >= 11.
-#
-# For more information, see:
-#
-# Documentation/process/clang-format.rst
-# https://clang.llvm.org/docs/ClangFormat.html
-# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
-#
-# Taken from Linux v6.0 with some adjustments
---
-AccessModifierOffset: -4
AlignAfterOpenBracket: Align
-AlignArrayOfStructures: Left
-AlignConsecutiveAssignments: Consecutive
-AlignConsecutiveDeclarations: Consecutive
+AlignArrayOfStructures: None
AlignConsecutiveMacros: Consecutive
+AlignConsecutiveAssignments: Consecutive
AlignConsecutiveBitFields: Consecutive
+AlignConsecutiveDeclarations: Consecutive
AlignEscapedNewlines: Left
-AlignOperands: AlignAfterOperator
+AlignOperands: AlignAfterOperator
AlignTrailingComments: true
+AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
-AllowShortBlocksOnASingleLine: false
+AllowShortEnumsOnASingleLine: false
+AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
-AllowShortIfStatementsOnASingleLine: false
+AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
-AlwaysBreakAfterDefinitionReturnType: None
-AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
-AlwaysBreakTemplateDeclarations: false
-# Taken from RAIDIX Generic
-AttributeMacros:
- - '__init'
- - '__exit'
- - '__packed'
- - '__aligned'
- - '__rcu'
- - '__must_hold'
- - '__read_mostly'
-
+AlwaysBreakAfterReturnType: None
BinPackArguments: true
BinPackParameters: true
-BraceWrapping:
- AfterClass: false
- AfterControlStatement: false
- AfterEnum: false
- AfterFunction: true
- AfterNamespace: true
- AfterObjCDeclaration: false
- AfterStruct: false
- AfterUnion: false
- AfterExternBlock: false
- BeforeCatch: false
- BeforeElse: false
- IndentBraces: false
- SplitEmptyFunction: true
- SplitEmptyRecord: true
- SplitEmptyNamespace: true
-BreakBeforeBinaryOperators: NonAssignment
-BreakBeforeBraces: Custom
-BreakBeforeInheritanceComma: false
+BitFieldColonSpacing: Both
+BreakBeforeBraces: Linux
+BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
-BreakConstructorInitializersBeforeComma: false
-BreakConstructorInitializers: BeforeComma
-BreakAfterJavaFieldAnnotations: false
-BreakStringLiterals: false
-ColumnLimit: 80
-CommentPragmas: '^ IWYU pragma:'
-CompactNamespaces: false
-ConstructorInitializerAllOnOneLineOrOnePerLine: false
-ConstructorInitializerIndentWidth: 8
-ContinuationIndentWidth: 8
-Cpp11BracedListStyle: false
-DerivePointerAlignment: false
-DisableFormat: false
+BreakStringLiterals: true
+ColumnLimit: 80
+DeriveLineEnding: false
+DisableFormat: false
ExperimentalAutoDetectBinPacking: false
-FixNamespaceComments: false
-
-# Taken from:
-# git grep -h '^#define [^[:space:]]*for_each[^[:space:]]*(' include/ tools/ \
-# | sed "s,^#define \([^[:space:]]*for_each[^[:space:]]*\)(.*$, - '\1'," \
-# | LC_ALL=C sort -u
-ForEachMacros:
- - 'hlist_bl_for_each_entry'
- - 'hlist_bl_for_each_entry_rcu'
- - 'hlist_bl_for_each_entry_safe'
- - 'hlist_for_each'
- - 'hlist_for_each_entry'
- - 'hlist_for_each_entry_continue'
- - 'hlist_for_each_entry_continue_rcu'
- - 'hlist_for_each_entry_continue_rcu_bh'
- - 'hlist_for_each_entry_from'
- - 'hlist_for_each_entry_from_rcu'
- - 'hlist_for_each_entry_rcu'
- - 'hlist_for_each_entry_rcu_bh'
- - 'hlist_for_each_entry_rcu_notrace'
- - 'hlist_for_each_entry_safe'
- - 'hlist_for_each_entry_srcu'
- - 'hlist_for_each_safe'
- - 'hlist_nulls_for_each_entry'
- - 'hlist_nulls_for_each_entry_from'
- - 'hlist_nulls_for_each_entry_rcu'
- - 'hlist_nulls_for_each_entry_safe'
- - 'hmap_iter_foreach'
- - 'list_for_each'
- - 'list_for_each_codec'
- - 'list_for_each_codec_safe'
- - 'list_for_each_continue'
- - 'list_for_each_entry'
- - 'list_for_each_entry_continue'
- - 'list_for_each_entry_continue_rcu'
- - 'list_for_each_entry_continue_reverse'
- - 'list_for_each_entry_from'
- - 'list_for_each_entry_from_rcu'
- - 'list_for_each_entry_from_reverse'
- - 'list_for_each_entry_lockless'
- - 'list_for_each_entry_rcu'
- - 'list_for_each_entry_reverse'
- - 'list_for_each_entry_safe'
- - 'list_for_each_entry_safe_continue'
- - 'list_for_each_entry_safe_from'
- - 'list_for_each_entry_safe_reverse'
- - 'list_for_each_entry_srcu'
- - 'list_for_each_from'
- - 'list_for_each_prev'
- - 'list_for_each_prev_safe'
- - 'list_for_each_safe'
- - 'llist_for_each'
- - 'llist_for_each_entry'
- - 'llist_for_each_entry_safe'
- - 'llist_for_each_safe'
-
-IncludeBlocks: Preserve
-IncludeCategories:
- - Regex: '.*'
- Priority: 1
-IncludeIsMainRegex: '(Test)?$'
+IncludeBlocks: Preserve
IndentCaseLabels: false
+IndentCaseBlocks: false
IndentGotoLabels: false
IndentPPDirectives: None
-IndentWidth: 4
+IndentExternBlock: NoIndent
+IndentWidth: 4
IndentWrappedFunctionNames: false
+InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
-KeepEmptyLinesAtTheStartOfBlocks: true
-MacroBlockBegin: ''
-MacroBlockEnd: ''
+KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
-NamespaceIndentation: None
-ObjCBinPackProtocolList: Auto
-ObjCBlockIndentWidth: 4
-ObjCSpaceAfterProperty: true
-ObjCSpaceBeforeProtocolList: true
-
-# Taken from git's rules
-PenaltyBreakAssignment: 30
-PenaltyBreakBeforeFirstCallParameter: 10
-PenaltyBreakComment: 10
-PenaltyBreakFirstLessLess: 0
-PenaltyBreakString: 10
-PenaltyExcessCharacter: 100
-PenaltyReturnTypeOnItsOwnLine: 60
-
PointerAlignment: Right
-ReflowComments: false
-SortIncludes: false
-SortUsingDeclarations: false
+PPIndentWidth: 0
+ReflowComments: true
+SortIncludes: Never
SpaceAfterCStyleCast: false
-SpaceAfterTemplateKeyword: true
+SpaceAfterLogicalNot: false
SpaceBeforeAssignmentOperators: true
-SpaceBeforeCtorInitializerColon: true
-SpaceBeforeInheritanceColon: true
-SpaceBeforeParens: ControlStatementsExceptForEachMacros
-SpaceBeforeRangeBasedForLoopColon: true
+SpaceBeforeCaseColon: false
+SpaceBeforeCpp11BracedList: false
+SpaceBeforeParens: ControlStatements
+SpaceAroundPointerQualifiers: Default
+SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
-SpacesBeforeTrailingComments: 1
-SpacesInAngles: false
-SpacesInContainerLiterals: false
+SpacesBeforeTrailingComments: 2
+SpacesInConditionalStatement: false
+SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
+SpacesInLineCommentPrefix:
+ Minimum: 1
+ Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
-Standard: Auto
-TabWidth: 4
-UseTab: Always
-...
+SpaceBeforeSquareBrackets: false
+Standard: Auto
+TabWidth: 4
+UseCRLF: false
+UseTab: Always