Add formatting tools
This commit is contained in:
parent
a09e50f5ec
commit
db6c5215df
12
.clang-format
Normal file
12
.clang-format
Normal file
@ -0,0 +1,12 @@
|
||||
---
|
||||
BasedOnStyle: LLVM
|
||||
AllowShortBlocksOnASingleLine: 'true'
|
||||
AllowShortCaseLabelsOnASingleLine: 'true'
|
||||
AllowShortFunctionsOnASingleLine: Inline
|
||||
AllowShortIfStatementsOnASingleLine: WithoutElse
|
||||
AllowShortLambdasOnASingleLine: Inline
|
||||
AllowShortLoopsOnASingleLine: 'false'
|
||||
AlwaysBreakBeforeMultilineStrings: 'true'
|
||||
IndentWidth: '4'
|
||||
|
||||
...
|
13
tools/format.sh
Executable file
13
tools/format.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
clang_format_command="clang-format"
|
||||
clang_tidy_command="run-clang-tidy"
|
||||
fi
|
||||
if [[ "$OSTYPE" == "linux"* ]]; then
|
||||
clang_format_command="clang-format-11"
|
||||
clang_tidy_command="run-clang-tidy-11"
|
||||
fi
|
||||
|
||||
eval "$clang_format_command -i *.h *.cpp -style=file"
|
||||
eval "$clang_tidy_command -fix"
|
Loading…
x
Reference in New Issue
Block a user