Add a .clang-format file implementing the Icinga 2 style guide

This commit is contained in:
Johannes Schmidt 2025-07-24 16:21:18 +02:00
parent c28076a45b
commit 2b84beffc9
2 changed files with 26 additions and 0 deletions

25
.clang-format Normal file
View File

@ -0,0 +1,25 @@
---
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
BreakBeforeBraces: Mozilla
ColumnLimit: 100
IncludeCategories:
- Regex: ^"(base|icinga|remote|test)/
Priority: 1
CaseSensitive: false
- Regex: ^<boost/
Priority: 2
CaseSensitive: false
- Regex: ^<
Priority: 3
CaseSensitive: false
IndentCaseLabels: true
IndentWidth: 4
PenaltyBreakAssignment: 50
PenaltyBreakBeforeFirstCallParameter: 50
PenaltyBreakOpenParenthesis: 50
PointerAlignment: Left
ReferenceAlignment: Left
TabWidth: 4
UseTab: Always

1
.gitignore vendored
View File

@ -3,6 +3,7 @@
# Except those related to git and vagrant
!.git*
!.clang-format
!.puppet*
!.travis.yml
!.mailmap