Skip to content

Commit

Permalink
Configuration for clang-format.
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottslaughter committed Oct 11, 2019
1 parent 0bb20d1 commit a2f3d58
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
Language: Cpp
BasedOnStyle: Google
IndentWidth: 4
ColumnLimit: 90
AccessModifierOffset: -4
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8
SortIncludes: false # breaks the build when enabled
16 changes: 16 additions & 0 deletions format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e

for f in src/*.c src/*.cpp src/*.h release/include/*/*.h tests/*.h tests/*/*.h; do
# Skip files that are imported from external sources.
if [[ ! $f = src/bin2c.* && \
! $f = src/lctype.* && \
! $f = src/linenoise.* && \
! $f = src/lj_strscan.* && \
! $f = src/lstring.* && \
! $f = src/lzio.* && \
! $f = src/MSVCSetupAPI.* ]]; then
clang-format -i "$f"
fi
done

0 comments on commit a2f3d58

Please sign in to comment.