aboutsummaryrefslogtreecommitdiffstats
path: root/.clang-format
diff options
context:
space:
mode:
authorBrent Stapleton <brent.stapleton@ettus.com>2018-09-21 11:15:15 -0700
committerBrent Stapleton <bstapleton@g.hmc.edu>2018-11-12 11:29:38 -0800
commit4a6b623b5c8e0d0d12fe7d6eb43ed6bb31f341af (patch)
tree5c77f0dc9ebd620b05debe1c07e15407e627e975 /.clang-format
parentb91dec65a2a04e166840027482c8891b6a8751b5 (diff)
downloaduhd-4a6b623b5c8e0d0d12fe7d6eb43ed6bb31f341af.tar.gz
uhd-4a6b623b5c8e0d0d12fe7d6eb43ed6bb31f341af.tar.bz2
uhd-4a6b623b5c8e0d0d12fe7d6eb43ed6bb31f341af.zip
uhd: add .clang-format file
Adding clang-format configuration file. The chosen style is meant to match current UHD coding style, except in certain cases where we have consciously decided to format our code in a particular way.
Diffstat (limited to '.clang-format')
-rw-r--r--.clang-format92
1 files changed, 92 insertions, 0 deletions
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 000000000..d41318ec7
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,92 @@
+---
+Language: Cpp
+AccessModifierOffset: -4
+AlignAfterOpenBracket: DontAlign
+AlignConsecutiveAssignments: true
+AlignConsecutiveDeclarations: false
+AlignEscapedNewlines: Left
+AlignOperands: true
+AlignTrailingComments: false
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: false
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: Empty
+AllowShortIfStatementsOnASingleLine: false
+AllowShortLoopsOnASingleLine: false
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: false
+AlwaysBreakTemplateDeclarations: false
+BinPackArguments: false
+BinPackParameters: false
+BreakBeforeBinaryOperators: NonAssignment
+BreakBeforeBraces: Custom
+BraceWrapping:
+ AfterClass: true
+ AfterControlStatement: false
+ AfterEnum: false
+ AfterFunction: true
+ AfterNamespace: false
+ AfterStruct: true
+BreakBeforeInheritanceComma: false
+BreakBeforeTernaryOperators: true
+BreakConstructorInitializers: BeforeComma
+BreakStringLiterals: true
+ColumnLimit: 90
+CompactNamespaces: true
+ConstructorInitializerAllOnOneLineOrOnePerLine: true
+ConstructorInitializerIndentWidth: 4
+ContinuationIndentWidth: 4
+Cpp11BracedListStyle: true
+DerivePointerAlignment: false
+DisableFormat: false
+ExperimentalAutoDetectBinPacking: false
+ForEachMacros:
+ - foreach
+ - BOOST_FOREACH
+IncludeBlocks: Merge
+IncludeCategories:
+ - Regex: '^"(uhd)/'
+ Priority: 1
+ - Regex: '^"(uhdlib)/'
+ Priority: 2
+ - Regex: '^<(uhd)/'
+ Priority: 3
+ - Regex: '^<(uhdlib)/'
+ Priority: 4
+ - Regex: '^<(boost)/'
+ Priority: 98
+ - Regex: '^<[a-z]*>$'
+ Priority: 99
+ - Regex: '.*'
+ Priority: 10
+
+IndentCaseLabels: true
+IndentPPDirectives: AfterHash
+IndentWidth: 4
+IndentWrappedFunctionNames: false
+KeepEmptyLinesAtTheStartOfBlocks: false
+MaxEmptyLinesToKeep: 2
+NamespaceIndentation: None
+PenaltyBreakAssignment: 10
+PenaltyBreakBeforeFirstCallParameter: 19
+PenaltyBreakComment: 300
+PenaltyBreakFirstLessLess: 120
+PenaltyBreakString: 1000
+PenaltyExcessCharacter: 1000000
+PenaltyReturnTypeOnItsOwnLine: 60
+PointerAlignment: Left
+ReflowComments: true
+SortIncludes: true
+SpaceAfterCStyleCast: false
+SpaceAfterTemplateKeyword: true
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeParens: ControlStatements
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 1
+SpacesInAngles: false
+SpacesInContainerLiterals: false
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+Standard: Cpp11
+TabWidth: 8
+UseTab: Never