add clang-format

This commit is contained in:
Jussi Kuokkanen 2023-07-26 16:32:34 +03:00
parent cd2ec6c0a3
commit 1e829c094f
2 changed files with 27 additions and 0 deletions

19
.clang-format Normal file
View File

@ -0,0 +1,19 @@
Language: Cpp
# Unindent access modifiers after regular indenting
AccessModifierOffset: -8
AlignAfterOpenBracket: DontAlign
AllowShortEnumsOnASingleLine: false
ColumnLimit: 100
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: Never
IndentAccessModifiers: false
IndentPPDirectives: BeforeHash
IndentWrappedFunctionNames: true
PointerAlignment: Right
SortIncludes: Never # src/plugins/Nvidia.cpp breaks with this on
# 8 column tabs
IndentWidth: 8
TabWidth: 8
UseTab: Always

8
clangFormat.sh Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env sh
cppPat=(-name "*.cpp" -o -name "*.hpp" -o -name "*.h")
clang-format -i $(
(find src/tuxclocker-qt/ ${cppPat[@]}
find src/tuxclockerd/ ${cppPat[@]}
find src/plugins/ ${cppPat[@]}
find src/lib/ ${cppPat[@]}
find src/include/ -maxdepth 1 ${cppPat[@]}))