Include clang-format config and corresponding makefile target
This commit is contained in:
parent
99be9826ae
commit
a1c041481c
2 changed files with 24 additions and 0 deletions
19
.clang-format
Normal file
19
.clang-format
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
BasedOnStyle: LLVM
|
||||||
|
IndentWidth: 4
|
||||||
|
TabWidth: 4
|
||||||
|
UseTab: Never
|
||||||
|
ColumnLimit: 120
|
||||||
|
AllowShortLoopsOnASingleLine: true
|
||||||
|
AllowShortFunctionsOnASingleLine: false
|
||||||
|
AlwaysBreakTemplateDeclarations: true
|
||||||
|
BreakConstructorInitializers: BeforeComma
|
||||||
|
AlignConsecutiveDeclarations:
|
||||||
|
Enabled: true
|
||||||
|
AcrossEmptyLines: false
|
||||||
|
AcrossComments: false
|
||||||
|
AlignCompound: false
|
||||||
|
AlignFunctionPointers: false
|
||||||
|
PadOperators: false
|
||||||
|
AlignConsecutiveMacros: true
|
||||||
|
AllowShortCaseLabelsOnASingleLine: true
|
||||||
|
SeparateDefinitionBlocks: Always
|
||||||
5
Makefile
5
Makefile
|
|
@ -102,5 +102,10 @@ disasm: main.elf
|
||||||
cpp:
|
cpp:
|
||||||
$(COMPILE) -E $(SOURCEDIR)/main.c
|
$(COMPILE) -E $(SOURCEDIR)/main.c
|
||||||
|
|
||||||
|
format:
|
||||||
|
find . -type f \( -name '*.c' -o -name '*.h' \) -exec clang-format -i {} +
|
||||||
|
|
||||||
# include generated header dependencies
|
# include generated header dependencies
|
||||||
-include $(BUILDDIR)/$(OBJECTS:.o=.d)
|
-include $(BUILDDIR)/$(OBJECTS:.o=.d)
|
||||||
|
|
||||||
|
.PHONY: format
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue