mirror of
https://github.com/opentx/opentx.git
synced 2025-07-13 11:29:51 +03:00
Add tool: clang-format.sh (#7940)
Signed-off-by: anton <haglundanton+github@gmail.com>
This commit is contained in:
parent
499328346c
commit
8a93eb8461
1 changed files with 26 additions and 0 deletions
26
tools/clang-format.sh
Executable file
26
tools/clang-format.sh
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Automatic indentation of all .c, .cpp and .h-files using clang-format
|
||||
# based on https://github.com/opentx/opentx/wiki/OpenTX-Code-Style-Guide
|
||||
|
||||
# clang-format version 10.0.0
|
||||
|
||||
for i in $(find ./ -name "*.c" -or -name "*.cpp" -or -name "*.h")
|
||||
do
|
||||
echo $i
|
||||
clang-format -i -style="{BasedOnStyle: LLVM,
|
||||
IndentWidth: 2,
|
||||
UseTab: Never,
|
||||
|
||||
AllowShortBlocksOnASingleLine: false,
|
||||
AllowShortIfStatementsOnASingleLine: false,
|
||||
AllowShortFunctionsOnASingleLine: false,
|
||||
|
||||
BreakBeforeBraces: Custom,
|
||||
BraceWrapping: { AfterFunction: true,
|
||||
BeforeElse: true },
|
||||
|
||||
IndentCaseLabels: true,
|
||||
PenaltyReturnTypeOnItsOwnLine: 0,
|
||||
ColumnLimit: 120}" $i
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue