Compare commits

...

3 commits

Author SHA1 Message Date
Alexander Richardson
138fa90f54 Merge branch 'clang-format-config' into 'main'
Add a basic .clang-format that mostly matches existing style

See merge request wayland/wayland!121
2025-08-10 02:01:23 +00:00
Alex Richardson
dff9f5efce Comment out clang-format directives that depend on clang 12 2021-03-22 13:18:39 +00:00
Alex Richardson
3a8884a54a Add a basic .clang-format that mostly matches existing style
This allows me to use git-clang-format. It also ensures that my IDE
correctly indents code correctly while I'm typing.
2021-03-19 15:27:21 +00:00

33
.clang-format Normal file
View file

@ -0,0 +1,33 @@
BasedOnStyle: LLVM
# TODO-clang-12: AlignConsecutiveMacros: AcrossEmptyLinesAndComments
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AlwaysBreakAfterReturnType: All
BreakBeforeBraces: Linux
BreakStringLiterals: false
ContinuationIndentWidth: 8
Cpp11BracedListStyle: false
ForEachMacros:
- wl_array_for_each
- wl_client_for_each
- wl_list_for_each
- wl_list_for_each_reverse_safe
- wl_list_for_each_safe
- STAILQ_FOREACH
IndentWidth: 8
PenaltyBreakAssignment: 1000
PenaltyBreakBeforeFirstCallParameter: 1000
PointerAlignment: Right
# Reflow comments breaks some HTML tags in doc comments
ReflowComments: false
# Not sure about SpaceAfterCStyleCast, some files use it others don't
SpaceAfterCStyleCast: true
# TODO-clang-12: SortIncludes: Never
SpaceBeforeParens: ControlStatementsExceptForEachMacros
# TODO-clang-12: SpaceAroundPointerQualifiers: Before
TabWidth: 8
UseTab: ForContinuationAndIndentation