mirror of
https://github.com/labwc/labwc.git
synced 2025-10-28 05:40:22 -04:00
add .clang-format (with a disclaimer)
.clang-format gets picked up nowadays by some IDEs (tested Qt Creator) for auto-formatting aids. With the large caveat that it's not 100% accurate to labwc's preferred coding style, I've found that this config gets it right 90% of the time, which is enough to be helpful. I added a prominent disclaimer comment to the top of the file to warn people away from relying completely on clang-format. This isn't meant to replace manual attention to formatting details (or to replace ./scripts/check) but I think it doesn't hurt.
This commit is contained in:
parent
069e22f2b6
commit
1e514c7550
1 changed files with 25 additions and 0 deletions
25
.clang-format
Normal file
25
.clang-format
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Note: this is an VERY rough approximation of labwc's coding style (see
|
||||
# CONTRIBUTING.md) and is intended only as a hint for IDE formatting
|
||||
# aids. DO NOT rely on clang-format or your IDE for correct formatting;
|
||||
# always check the result manually (and run ./scripts/check)!
|
||||
#
|
||||
# Some notable things that clang-format gets wrong:
|
||||
# - no support for double-indenting before an opening brace
|
||||
# - does not always round continuation indent/alignment to tab stops
|
||||
|
||||
BasedOnStyle: LLVM
|
||||
UseTab: Always
|
||||
IndentWidth: 8
|
||||
ContinuationIndentWidth: 8
|
||||
AlignAfterOpenBracket: DontAlign
|
||||
AlwaysBreakAfterDefinitionReturnType: true
|
||||
BreakBeforeBinaryOperators: NonAssignment
|
||||
BreakBeforeBraces: Linux
|
||||
IndentCaseLabels: false
|
||||
SpaceBeforeParens: ControlStatementsExceptControlMacros
|
||||
ForEachMacros: ['for_each_view',
|
||||
'wl_array_for_each',
|
||||
'wl_list_for_each',
|
||||
'wl_list_for_each_reverse',
|
||||
'wl_list_for_each_reverse_safe',
|
||||
'wl_list_for_each_safe']
|
||||
Loading…
Add table
Add a link
Reference in a new issue