Skip to content

Commit

Permalink
Merge pull request pmem#43 from karczex/clang_format
Browse files Browse the repository at this point in the history
Clang format
  • Loading branch information
lukaszstolarczuk authored Dec 28, 2020
2 parents 4f624f7 + e52526c commit 1da5630
Show file tree
Hide file tree
Showing 25 changed files with 3,102 additions and 2,685 deletions.
34 changes: 34 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
AccessModifierOffset: -8
AlignOperands: false
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: false
AlwaysBreakTemplateDeclarations: true
BasedOnStyle: LLVM
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBraces: Custom
BreakStringLiterals: false
ColumnLimit: 110
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ContinuationIndentWidth: 8
FixNamespaceComments: false
IndentCaseLabels: true
IndentWidth: 8
PointerAlignment: Right
SpaceBeforeParens: ControlStatements
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
UseTab: Always
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Format c++ code with clang-format
b6642350ba8921fe04a0eb56190c538cf60e7743
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

bench: CFLAGS = $(shell pkg-config --cflags libpmemkv) -DOS_LINUX -fno-builtin-memcmp -march=native -DNDEBUG -O2 -std=c++11
bench: LDFLAGS = -ldl -lpthread $(shell pkg-config --libs libpmemkv)
CPP_FILES = $(shell find . -iname "*.h" -o -iname "*.cc" -o -iname "*.cpp" -o -iname "*.hpp")

.PHONY: cppformat $(CPP_FILES)

reset:
rm -rf /dev/shm/pmemkv /tmp/pmemkv
Expand All @@ -17,3 +20,8 @@ bench: reset

run_bench: bench
PMEM_IS_PMEM_FORCE=1 ./pmemkv_bench --db=/dev/shm/pmemkv --db_size_in_gb=1 --histogram=1

cppformat: $(CPP_FILES)

$(CPP_FILES):
clang-format-10 -i $@
Loading

0 comments on commit 1da5630

Please sign in to comment.