From 9d1a1d51d034062c80d4f0675f1fee640e405d5c Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Wed, 26 Feb 2020 19:46:58 +0100 Subject: [PATCH] replace clag format with astyle --- .clang-format | 97 -------------------------------------- scripts/clang-formatter.sh | 13 ----- scripts/code-format.cfg | 26 ++++++++++ scripts/code-format.sh | 1 + 4 files changed, 27 insertions(+), 110 deletions(-) delete mode 100644 .clang-format delete mode 100755 scripts/clang-formatter.sh create mode 100644 scripts/code-format.cfg create mode 100755 scripts/code-format.sh diff --git a/.clang-format b/.clang-format deleted file mode 100644 index a8674b33f..000000000 --- a/.clang-format +++ /dev/null @@ -1,97 +0,0 @@ ---- -Language: Cpp -# BasedOnStyle: LLVM -AccessModifierOffset: -2 -AlignAfterOpenBracket: Align -AlignConsecutiveAssignments: true -AlignConsecutiveDeclarations: false -AlignEscapedNewlinesLeft: false -AlignOperands: true -AlignTrailingComments: true -AllowAllParametersOfDeclarationOnNextLine: true -AllowShortBlocksOnASingleLine: false -AllowShortCaseLabelsOnASingleLine: true -AllowShortFunctionsOnASingleLine: None -AllowShortIfStatementsOnASingleLine: true -AllowShortLoopsOnASingleLine: true -AlwaysBreakAfterDefinitionReturnType: None -AlwaysBreakAfterReturnType: None -AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: false -BinPackArguments: true -BinPackParameters: true -BreakBeforeBraces: Custom -BraceWrapping: - AfterClass: false - AfterControlStatement: false - AfterEnum: false - AfterFunction: true - AfterNamespace: false - AfterObjCDeclaration: false - AfterStruct: true - AfterUnion: true - BeforeCatch: false - BeforeElse: false - IndentBraces: false - SplitEmptyFunction: false -BreakBeforeBinaryOperators: None -BreakBeforeTernaryOperators: true -BreakConstructorInitializersBeforeComma: false -BreakAfterJavaFieldAnnotations: false -BreakStringLiterals: true -ColumnLimit: 120 -CommentPragmas: '^ IWYU pragma:' -ConstructorInitializerAllOnOneLineOrOnePerLine: false -ConstructorInitializerIndentWidth: 4 -ContinuationIndentWidth: 4 -Cpp11BracedListStyle: true -DerivePointerAlignment: false -DisableFormat: false -ExperimentalAutoDetectBinPacking: false -ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] -IncludeCategories: - - Regex: '^"(llvm|llvm-c|clang|clang-c)/' - Priority: 2 - - Regex: '^(<|"(gtest|isl|json)/)' - Priority: 3 - - Regex: '.*' - Priority: 1 -IncludeIsMainRegex: '$' -IndentCaseLabels: true -IndentWidth: 4 -IndentWrappedFunctionNames: false -JavaScriptQuotes: Leave -JavaScriptWrapImports: true -KeepEmptyLinesAtTheStartOfBlocks: true -MacroBlockBegin: '' -MacroBlockEnd: '' -MaxEmptyLinesToKeep: 1 -NamespaceIndentation: None -ObjCBlockIndentWidth: 2 -ObjCSpaceAfterProperty: false -ObjCSpaceBeforeProtocolList: true -PenaltyBreakBeforeFirstCallParameter: 19 -PenaltyBreakComment: 300 -PenaltyBreakFirstLessLess: 120 -PenaltyBreakString: 1000 -PenaltyExcessCharacter: 1000000 -PenaltyReturnTypeOnItsOwnLine: 60 -PointerAlignment: Middle -ReflowComments: true -SortIncludes: false -SpaceAfterCStyleCast: false -SpaceAfterTemplateKeyword: true -SpaceBeforeAssignmentOperators: true -SpaceBeforeParens: Never -SpaceInEmptyParentheses: false -SpacesBeforeTrailingComments: 1 -SpacesInAngles: false -SpacesInContainerLiterals: false -SpacesInCStyleCastParentheses: false -SpacesInParentheses: false -SpacesInSquareBrackets: false -Standard: Cpp11 -TabWidth: 4 -UseTab: Never -... - diff --git a/scripts/clang-formatter.sh b/scripts/clang-formatter.sh deleted file mode 100755 index adf2a993d..000000000 --- a/scripts/clang-formatter.sh +++ /dev/null @@ -1,13 +0,0 @@ -clang-format-7 -style=file ../src/lv_core/*.c -i -clang-format-7 -style=file ../src/lv_draw/*.c -i -clang-format-7 -style=file ../src/lv_hal/*.c -i -clang-format-7 -style=file ../src/lv_misc/*.c -i -clang-format-7 -style=file ../src/lv_widgets/*.c -i -clang-format-7 -style=file ../src/lv_themes/*.c -i - -clang-format-7 -style=file ../src/lv_core/*.h -i -clang-format-7 -style=file ../src/lv_draw/*.h -i -clang-format-7 -style=file ../src/lv_hal/*.h -i -clang-format-7 -style=file ../src/lv_misc/*.h -i -clang-format-7 -style=file ../src/lv_widgets/*.h -i -clang-format-7 -style=file ../src/lv_themes/*.h -i diff --git a/scripts/code-format.cfg b/scripts/code-format.cfg new file mode 100644 index 000000000..f85827b72 --- /dev/null +++ b/scripts/code-format.cfg @@ -0,0 +1,26 @@ +--style=kr +--indent=spaces=4 +--indent-classes +--indent-switches +--indent-cases +--indent-preproc-block +--indent-preproc-define +--indent-col1-comments +--pad-oper +--unpad-paren +--align-pointer=middle +--align-reference=middle +--convert-tabs +--max-code-length=120 +--break-after-logical +--break-closing-braces +--attach-closing-while +--min-conditional-indent=0 +--max-continuation-indent=120 +--mode=c +--lineend=linux +--recursive +--suffix=none +--preserve-date +--formatted +--exclude=lv_conf_internal.h diff --git a/scripts/code-format.sh b/scripts/code-format.sh new file mode 100755 index 000000000..561f43309 --- /dev/null +++ b/scripts/code-format.sh @@ -0,0 +1 @@ +astyle --options=code-format.cfg "../src/*.c,*.h"