Skip to content

Commit

Permalink
Changed clang-format a bit and added script to reformat files
Browse files Browse the repository at this point in the history
Signed-off-by: Mikhail Koviazin <[email protected]>
  • Loading branch information
mkmkme committed Aug 21, 2024
1 parent 641f1de commit 8ea51b3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
BasedOnStyle: LLVM
IndentWidth: 4
BreakBeforeTernaryOperators: false
ReflowComments: false
ReflowComments: false
AllowAllArgumentsOnNextLine: true
AlignTrailingComments: Always
IncludeBlocks: Regroup
IncludeCategories:
# fmacros.h must always be first since it defines macros that affect the
# other includes
- Regex: '^"fmacros.h"'
Priority: -1
- Regex: '^"'
Priority: 1
- Regex: '^<(valkey/adapters)/'
Priority: 3
- Regex: '^<(valkey)/'
Priority: 2
- Regex: '^<'
Priority: 4
- Regex: '.*'
Priority: 5
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ obj
lib
compile_commands.json
.cache
/build*
5 changes: 5 additions & 0 deletions scripts/format-files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

find examples include libvalkey src tests \
\( -name '*.c' -or -name '*.cpp' -or -name '*.h' \) \
-exec clang-format -i {} + ;

0 comments on commit 8ea51b3

Please sign in to comment.