Create clang-format spec
This commit is contained in:
parent
19faa5dc4c
commit
3fdfaf815b
|
@ -0,0 +1 @@
|
||||||
|
BasedOnStyle: LLVM
|
6
Makefile
6
Makefile
|
@ -1044,16 +1044,16 @@ ALL_SOURCE = $(shell find . \( -type f \( -name '*.c' -o -name '*.cpp' \) \) )
|
||||||
style:
|
style:
|
||||||
@for src in $(ALL_SOURCE) $(ALL_INCLUDES); do \
|
@for src in $(ALL_SOURCE) $(ALL_INCLUDES); do \
|
||||||
echo "Formatting $$src..." ; \
|
echo "Formatting $$src..." ; \
|
||||||
clang-format -style=llvm -i "$$src" ; \
|
clang-format -i "$$src" ; \
|
||||||
done
|
done
|
||||||
@echo "Done"
|
@echo "Done"
|
||||||
|
|
||||||
check-style:
|
check-style:
|
||||||
@for src in $(ALL_SOURCE) $(ALL_INCLUDES) ; do \
|
@for src in $(ALL_SOURCE) $(ALL_INCLUDES) ; do \
|
||||||
var=`clang-format -style=llvm "$$src" | diff "$$src" - | wc -l` ; \
|
var=`clang-format "$$src" | diff "$$src" - | wc -l` ; \
|
||||||
if [ $$var -ne 0 ] ; then \
|
if [ $$var -ne 0 ] ; then \
|
||||||
echo "$$src does not respect the coding style (diff: $$var lines)" ; \
|
echo "$$src does not respect the coding style (diff: $$var lines)" ; \
|
||||||
clang-format -style=llvm "$$src" | diff "$$src" -; \
|
clang-format "$$src" | diff "$$src" -; \
|
||||||
exit 1 ; \
|
exit 1 ; \
|
||||||
fi ; \
|
fi ; \
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue