diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..3840d47 --- /dev/null +++ b/.clang-format @@ -0,0 +1,21 @@ +--- +BasedOnStyle: WebKit +AlignAfterOpenBracket: AlwaysBreak +AlignConsecutiveMacros: false +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: DontAlign +AlignOperands: false +AlignTrailingComments: false +TabWidth: 4 +UseTab: ForIndentation +DerivePointerAlignment: false +PointerAlignment: Right +BinPackArguments: true +BinPackParameters: true +ExperimentalAutoDetectBinPacking: false +AllowAllArgumentsOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortFunctionsOnASingleLine: None +ColumnLimit: 77 +... diff --git a/scripts/format.sh b/scripts/format.sh new file mode 100644 index 0000000..9124d63 --- /dev/null +++ b/scripts/format.sh @@ -0,0 +1,5 @@ +cd "$(git rev-parse --show-toplevel)" +find . -not \( -path './.git' -prune \) \ + -not \( -path './build' -prune \) \ + -name '*.c' -o -name '*.h' \ + | xargs -n 1 clang-format -i