From ce5e207a514ddc4afaf1bb151c6a268ed21e83f1 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Mon, 21 Oct 2024 18:00:55 +0200 Subject: [PATCH] allow pretification of code (not qemu's) --- .clang-format | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++ Makefile | 3 +++ 2 files changed, 62 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..126882a --- /dev/null +++ b/.clang-format @@ -0,0 +1,59 @@ +--- +Language: Cpp +ColumnLimit: 140 +IndentWidth: 4 +PPIndentWidth: 2 +UseTab: Never + +AlignArrayOfStructures: Left + +IndentCaseBlocks: true +IndentCaseLabels: true +IndentGotoLabels: false +IndentPPDirectives: AfterHash +IndentWrappedFunctionNames: true + +InsertBraces: false +InsertNewlineAtEOF: true + +MaxEmptyLinesToKeep: 1 + +PointerAlignment: Left +ReferenceAlignment: Left +QualifierAlignment: Left + +SortIncludes: false + +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyParentheses: false +SpacesInAngles: true +SpacesInCStyleCastParentheses: true +SpacesInContainerLiterals: true +SpacesInParentheses: true +SpacesInSquareBrackets: true +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false + +BreakBeforeBraces: Custom +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: Never + AfterEnum: false + AfterExternBlock: false + AfterFunction: true + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + BeforeCatch: false + BeforeElse: false + BeforeLambdaBody: false + BeforeWhile: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +... diff --git a/Makefile b/Makefile index 674ffa8..23ff84c 100644 --- a/Makefile +++ b/Makefile @@ -195,4 +195,7 @@ depend-and-build: depend depend: depend-libs $(MAKEDEPEND) $(CFLAGS) $(X49GP_CFLAGS) $(SRCS) >.depend +pretty-code: + clang-format -i *.c *.h + dummy: