From c73176035de5c2987c1cf21ef525387d07d904b1 Mon Sep 17 00:00:00 2001 From: Andrew-Kochanov Date: Sun, 23 Nov 2025 17:45:15 +0300 Subject: [PATCH 1/5] =?UTF-8?q?CI=20=D0=B4=D0=BB=D1=8F=20clanf-format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .CIclang/.clang-format | 245 ++++++++++++++++++ .CIclang/.github/dependabot.yml | 6 + .CIclang/.github/workflows/build-and-lint.yml | 24 ++ 3 files changed, 275 insertions(+) create mode 100644 .CIclang/.clang-format create mode 100644 .CIclang/.github/dependabot.yml create mode 100644 .CIclang/.github/workflows/build-and-lint.yml diff --git a/.CIclang/.clang-format b/.CIclang/.clang-format new file mode 100644 index 0000000..e2cbc59 --- /dev/null +++ b/.CIclang/.clang-format @@ -0,0 +1,245 @@ +--- +Language: Cpp +# BasedOnStyle: WebKit +AccessModifierOffset: -4 +AlignAfterOpenBracket: DontAlign +AlignArrayOfStructures: None +AlignConsecutiveAssignments: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: true +AlignConsecutiveBitFields: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: false +AlignConsecutiveDeclarations: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: false +AlignConsecutiveMacros: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: false +AlignConsecutiveShortCaseStatements: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCaseColons: false +AlignEscapedNewlines: Right +AlignOperands: DontAlign +AlignTrailingComments: + Kind: Never + OverEmptyLines: 0 +AllowAllArgumentsOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowBreakBeforeNoexceptSpecifier: Never +AllowShortBlocksOnASingleLine: Empty +AllowShortCaseLabelsOnASingleLine: false +AllowShortCompoundRequirementOnASingleLine: true +AllowShortEnumsOnASingleLine: true +AllowShortFunctionsOnASingleLine: All +AllowShortIfStatementsOnASingleLine: Never +AllowShortLambdasOnASingleLine: All +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: MultiLine +AttributeMacros: + - __capability +BinPackArguments: true +BinPackParameters: true +BitFieldColonSpacing: Both +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 +BreakAdjacentStringLiterals: true +BreakAfterAttributes: Leave +BreakAfterJavaFieldAnnotations: false +BreakArrays: true +BreakBeforeBinaryOperators: All +BreakBeforeConceptDeclarations: Always +BreakBeforeBraces: WebKit +BreakBeforeInlineASMColon: OnlyMultiline +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: BeforeComma +BreakInheritanceList: BeforeColon +BreakStringLiterals: true +ColumnLimit: 0 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: false +DerivePointerAlignment: false +DisableFormat: false +EmptyLineAfterAccessModifier: Never +EmptyLineBeforeAccessModifier: LogicalBlock +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: false +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IfMacros: + - KJ_IF_MAYBE +IncludeBlocks: Preserve +IncludeCategories: + - Regex: '^"(llvm|llvm-c|clang|clang-c)/' + Priority: 2 + SortPriority: 0 + CaseSensitive: false + - Regex: '^(<|"(gtest|gmock|isl|json)/)' + Priority: 3 + SortPriority: 0 + CaseSensitive: false + - Regex: '.*' + Priority: 1 + SortPriority: 0 + CaseSensitive: false +IncludeIsMainRegex: '(Test)?$' +IncludeIsMainSourceRegex: '' +IndentAccessModifiers: false +IndentCaseBlocks: false +IndentCaseLabels: false +IndentExternBlock: AfterExternBlock +IndentGotoLabels: true +IndentPPDirectives: None +IndentRequiresClause: true +IndentWidth: 4 +IndentWrappedFunctionNames: false +InsertBraces: false +InsertNewlineAtEOF: false +InsertTrailingCommas: None +IntegerLiteralSeparator: + Binary: 0 + BinaryMinDigits: 0 + Decimal: 0 + DecimalMinDigits: 0 + Hex: 0 + HexMinDigits: 0 +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: true +KeepEmptyLinesAtEOF: false +LambdaBodyIndentation: Signature +LineEnding: DeriveLF +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: Inner +ObjCBinPackProtocolList: Auto +ObjCBlockIndentWidth: 4 +ObjCBreakBeforeNestedBlockParam: true +ObjCSpaceAfterProperty: true +ObjCSpaceBeforeProtocolList: true +PackConstructorInitializers: BinPack +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakOpenParenthesis: 0 +PenaltyBreakScopeResolution: 500 +PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 10 +PenaltyExcessCharacter: 1000000 +PenaltyIndentedWhitespace: 0 +PenaltyReturnTypeOnItsOwnLine: 60 +PointerAlignment: Left +PPIndentWidth: -1 +QualifierAlignment: Leave +ReferenceAlignment: Pointer +ReflowComments: true +RemoveBracesLLVM: false +RemoveParentheses: Leave +RemoveSemicolon: false +RequiresClausePosition: OwnLine +RequiresExpressionIndentation: OuterScope +SeparateDefinitionBlocks: Leave +ShortNamespaceLines: 1 +SkipMacroDefinitionBody: false +SortIncludes: CaseSensitive +SortJavaStaticImport: Before +SortUsingDeclarations: LexicographicNumeric +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceAroundPointerQualifiers: Default +SpaceBeforeAssignmentOperators: true +SpaceBeforeCaseColon: false +SpaceBeforeCpp11BracedList: true +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeJsonColon: false +SpaceBeforeParens: ControlStatements +SpaceBeforeParensOptions: + AfterControlStatements: true + AfterForeachMacros: true + AfterFunctionDefinitionName: false + AfterFunctionDeclarationName: false + AfterIfMacros: true + AfterOverloadedOperator: false + AfterPlacementOperator: true + AfterRequiresInClause: false + AfterRequiresInExpression: false + BeforeNonEmptyParentheses: false +SpaceBeforeRangeBasedForLoopColon: true +SpaceBeforeSquareBrackets: false +SpaceInEmptyBlock: true +SpacesBeforeTrailingComments: 1 +SpacesInAngles: Never +SpacesInContainerLiterals: true +SpacesInLineCommentPrefix: + Minimum: 1 + Maximum: -1 +SpacesInParens: Never +SpacesInParensOptions: + InCStyleCasts: false + InConditionalStatements: false + InEmptyParentheses: false + Other: false +SpacesInSquareBrackets: false +Standard: Latest +StatementAttributeLikeMacros: + - Q_EMIT +StatementMacros: + - Q_UNUSED + - QT_REQUIRE_VERSION +TabWidth: 8 +UseTab: Never +VerilogBreakBetweenInstancePorts: true +WhitespaceSensitiveMacros: + - BOOST_PP_STRINGIZE + - CF_SWIFT_NAME + - NS_SWIFT_NAME + - PP_STRINGIZE + - STRINGIZE +... \ No newline at end of file diff --git a/.CIclang/.github/dependabot.yml b/.CIclang/.github/dependabot.yml new file mode 100644 index 0000000..355e687 --- /dev/null +++ b/.CIclang/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: "weekly" \ No newline at end of file diff --git a/.CIclang/.github/workflows/build-and-lint.yml b/.CIclang/.github/workflows/build-and-lint.yml new file mode 100644 index 0000000..9d85c5a --- /dev/null +++ b/.CIclang/.github/workflows/build-and-lint.yml @@ -0,0 +1,24 @@ +name: Build and lint + +on: + - push + - pull_request + +jobs: + build-and-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - name: Check format + run: | + find . -path ./build -prune -o -type f -name '*.[c|h]' -print | xargs clang-format-18 --style=file --dry-run -Werror + - name: Configure + run: | + # -DCMAKE_EXPORT_COMPILE_COMMANDS=ON is important for clang-tidy + cmake . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + - name: Build + run: | + cmake --build build + - name: Lint + run: | + run-clang-tidy-18 -p=build \ No newline at end of file From 59d707baf4f63ba5bb8dbc1ca7bb8136418250ca Mon Sep 17 00:00:00 2001 From: Andrew-Kochanov Date: Sun, 23 Nov 2025 17:54:41 +0300 Subject: [PATCH 2/5] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D1=84=D0=B0=D0=B9=D0=BB=20build-and-lint.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .CIclang/.github/workflows/build-and-lint.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.CIclang/.github/workflows/build-and-lint.yml b/.CIclang/.github/workflows/build-and-lint.yml index 9d85c5a..a2c12fd 100644 --- a/.CIclang/.github/workflows/build-and-lint.yml +++ b/.CIclang/.github/workflows/build-and-lint.yml @@ -12,13 +12,3 @@ jobs: - name: Check format run: | find . -path ./build -prune -o -type f -name '*.[c|h]' -print | xargs clang-format-18 --style=file --dry-run -Werror - - name: Configure - run: | - # -DCMAKE_EXPORT_COMPILE_COMMANDS=ON is important for clang-tidy - cmake . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - - name: Build - run: | - cmake --build build - - name: Lint - run: | - run-clang-tidy-18 -p=build \ No newline at end of file From 66168a67750c60ed1e7db9c336e489b7a7625a6d Mon Sep 17 00:00:00 2001 From: Andrew-Kochanov Date: Sat, 20 Dec 2025 23:11:45 +0300 Subject: [PATCH 3/5] CI --- .CIclang/.clang-format => .clang-format | 0 {.CIclang/.github => .github}/dependabot.yml | 1 + {.CIclang/.github => .github}/workflows/build-and-lint.yml | 2 +- 3 files changed, 2 insertions(+), 1 deletion(-) rename .CIclang/.clang-format => .clang-format (100%) rename {.CIclang/.github => .github}/dependabot.yml (87%) rename {.CIclang/.github => .github}/workflows/build-and-lint.yml (80%) diff --git a/.CIclang/.clang-format b/.clang-format similarity index 100% rename from .CIclang/.clang-format rename to .clang-format diff --git a/.CIclang/.github/dependabot.yml b/.github/dependabot.yml similarity index 87% rename from .CIclang/.github/dependabot.yml rename to .github/dependabot.yml index 355e687..a63b9b2 100644 --- a/.CIclang/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,3 +1,4 @@ +@@ -0,0 +1,6 @@ version: 2 updates: - package-ecosystem: github-actions diff --git a/.CIclang/.github/workflows/build-and-lint.yml b/.github/workflows/build-and-lint.yml similarity index 80% rename from .CIclang/.github/workflows/build-and-lint.yml rename to .github/workflows/build-and-lint.yml index a2c12fd..31983d4 100644 --- a/.CIclang/.github/workflows/build-and-lint.yml +++ b/.github/workflows/build-and-lint.yml @@ -11,4 +11,4 @@ jobs: - uses: actions/checkout@v5 - name: Check format run: | - find . -path ./build -prune -o -type f -name '*.[c|h]' -print | xargs clang-format-18 --style=file --dry-run -Werror + find . -path ./build -prune -o -type f -name '*.[c|h]' -print | xargs clang-format-18 --style=file --dry-run -Werror \ No newline at end of file From 8f58cfdb674d884b79dd6df70020e8aa6dd89f71 Mon Sep 17 00:00:00 2001 From: Andrew-Kochanov Date: Sat, 20 Dec 2025 23:32:44 +0300 Subject: [PATCH 4/5] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D1=83=20=D0=B2=20depend?= =?UTF-8?q?abot.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/dependabot.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a63b9b2..355e687 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,4 +1,3 @@ -@@ -0,0 +1,6 @@ version: 2 updates: - package-ecosystem: github-actions From f5b018ab218959949636bd27f1833dfb23aea89e Mon Sep 17 00:00:00 2001 From: Andrew-Kochanov Date: Sun, 21 Dec 2025 18:20:29 +0300 Subject: [PATCH 5/5] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BB=20=D1=82?= =?UTF-8?q?=D0=BE=D1=87=D0=BA=D0=B8=20=D0=B2=20=D0=BD=D0=B0=D1=87=D0=B0?= =?UTF-8?q?=D0=BB=D0=B5=20=D0=B8=20=D0=B2=20=D0=BA=D0=BE=D0=BD=D1=86=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .clang-format | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.clang-format b/.clang-format index e2cbc59..bda3ac9 100644 --- a/.clang-format +++ b/.clang-format @@ -1,4 +1,3 @@ ---- Language: Cpp # BasedOnStyle: WebKit AccessModifierOffset: -4 @@ -241,5 +240,4 @@ WhitespaceSensitiveMacros: - CF_SWIFT_NAME - NS_SWIFT_NAME - PP_STRINGIZE - - STRINGIZE -... \ No newline at end of file + - STRINGIZE \ No newline at end of file