Skip to content

Commit

Permalink
Apply initial cilium-specific tweaks
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Leggett <[email protected]>
  • Loading branch information
bleggett authored and julianwiedmann committed Jun 1, 2023
1 parent 73b4686 commit b482af0
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
# SPDX-License-Identifier: GPL-2.0
#
# clang-format configuration file. Intended for clang-format >= 11.
# clang-format configuration file. Intended for clang-format >= 15.
#
# For more information, see:
#
# Documentation/process/clang-format.rst
# https://clang.llvm.org/docs/ClangFormat.html
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
#
# Originally obtained from: https://github.com/torvalds/linux/blob/7acc1372113083fa281ba426021801e2402caca1/.clang-format
# Settings here should be compatible with (current-release-major - 2) of clang-format
---
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveBitFields:
Enabled: true
AcrossEmptyLines: true
AcrossComments: true
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: true
AcrossComments: true
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
Expand Down Expand Up @@ -63,6 +73,7 @@ DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: false

IncludeBlocks: Preserve
IncludeCategories:
- Regex: '.*'
Expand All @@ -86,13 +97,18 @@ ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true

# Taken from git's rules
# This decides in what order (weighting) things
# should be done if a line is too long
# 100 = try everything else before this.
# See https://stackoverflow.com/a/46749925
PenaltyBreakAssignment: 10
PenaltyBreakBeforeFirstCallParameter: 30
PenaltyBreakComment: 10
PenaltyBreakBeforeFirstCallParameter: 0
PenaltyBreakComment: 0
PenaltyBreakFirstLessLess: 0
PenaltyBreakString: 10
PenaltyBreakOpenParenthesis: 100
PenaltyExcessCharacter: 100
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyReturnTypeOnItsOwnLine: 100

PointerAlignment: Right
ReflowComments: false
Expand All @@ -102,8 +118,11 @@ SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatementsExceptForEachMacros
# kernel.org sets this to true,
# however this also seems to affect labels,
# which seems like a bug.
SpaceBeforeInheritanceColon: false
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
Expand Down

0 comments on commit b482af0

Please sign in to comment.