Adding clang-format script

All the code in zenity from now, will follow this format style
This commit is contained in:
Arx Cruz 2017-04-07 13:50:47 +02:00
parent 3b64d05e8a
commit 8c5e60de83
2 changed files with 37 additions and 0 deletions

34
.clang-format Normal file
View File

@ -0,0 +1,34 @@
---
BasedOnStyle: GNU
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: 'false'
AlignConsecutiveDeclarations: 'false'
AlignOperands: 'false'
AlignTrailingComments: 'false'
AllowAllParametersOfDeclarationOnNextLine: 'false'
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'false'
AllowShortFunctionsOnASingleLine: 'None'
AllowShortLoopsOnASingleLine: 'false'
AllowShortIfStatementsOnASingleLine: 'false'
BinPackArguments: 'false'
BinPackParameters: 'true'
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: 'true'
BreakConstructorInitializersBeforeComma: 'true'
Cpp11BracedListStyle: true
ColumnLimit: '80'
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
IndentCaseLabels: 'true'
Language: Cpp
NamespaceIndentation: None
PointerAlignment: Right
SortIncludes: 'true'
SpaceAfterCStyleCast: 'true'
Standard: Cpp03
IndentWidth: 4
TabWidth: 4
UseTab: Always
...

3
utils/format.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
find src -type f \( -iname '*.c' -or -iname '*.h' \) -exec clang-format -i -style=file {} \;