From c73176035de5c2987c1cf21ef525387d07d904b1 Mon Sep 17 00:00:00 2001 From: Andrew-Kochanov Date: Sun, 23 Nov 2025 17:45:15 +0300 Subject: [PATCH 1/8] =?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/8] =?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 3d5456db569b79d9e6944a88d5c7a8c7df3b0fd3 Mon Sep 17 00:00:00 2001 From: Andrew-Kochanov Date: Sat, 20 Dec 2025 21:23:02 +0300 Subject: [PATCH 3/8] =?UTF-8?q?=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D1=8F=20=D1=81=D0=BE=D1=80=D1=82=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=BD=D0=BE=D0=B3=D0=BE=20=D1=81=D0=BF=D0=B8?= =?UTF-8?q?=D1=81=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sortList/sortList.c | 104 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 sortList/sortList.c diff --git a/sortList/sortList.c b/sortList/sortList.c new file mode 100644 index 0000000..f953787 --- /dev/null +++ b/sortList/sortList.c @@ -0,0 +1,104 @@ +#include +#include +#include + +// элемент списка +typedef struct ListNode { + // значение + int value; + // ссылка на следующую "ячейку" + struct ListNode* next; +} ListNode; + +typedef struct List { + ListNode* head; +} List; + +// структура списка +ListNode* new(int value) +{ + ListNode* node = (ListNode*)malloc(sizeof(ListNode)); + node->value = value; + node->next = NULL; + return node; +} + +// положить элемент в соответствии с сортировкой +void insert(List* list, int value) +{ + ListNode* newNode = new(value); + + // Если список пуст или новый элемент меньше головы + if (list->head == NULL || value < list->head->value) { + newNode->next = list->head; + list->head = newNode; + return; + } + + // поиск того, куда вставить новый элемент + ListNode* current = list->head; + while (current->next != NULL && current->next->value < value) { + current = current->next; + } + + // вставка + newNode->next = current->next; + current->next = newNode; +} + +// проверка на возможность удаления элемента +bool deleteNode(List* list, int value) +{ + // если список пустой + if (list->head == NULL) { + return false; + } + + // если элемент это голова + if (list->head->value == value) { + ListNode* temprery = list->head; + list->head = list->head->next; + free(temprery); + return true; + } + + // поиск элемента для удаления + ListNode* current = list->head; + while (current->next != NULL && current->next->value != value) { + current = current->next; + } + + // Если элемент не найден + if (current->next == NULL) { + return 0; + } + + // удаление элемента + ListNode* temprery = current->next; + current->next = temprery->next; + free(temprery); + return true; +} + +// вывод списка +void printList(List* list) +{ + ListNode* current = list->head; + while (current != NULL) { + printf("%d ", current->value); + current = current->next; + } + printf("\n"); +} + +// удаление списка +void deleteList(List* list) +{ + ListNode* current = list->head; + while (current != NULL) { + ListNode* temprery = current; + current = current->next; + free(temprery); + } + list->head = NULL; +} From 6e37761b07621fbebd76c8a8f9784308c4788e93 Mon Sep 17 00:00:00 2001 From: Andrew-Kochanov Date: Sat, 20 Dec 2025 22:05:08 +0300 Subject: [PATCH 4/8] =?UTF-8?q?=D0=9F=D0=BE=D0=B4=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D0=BB=20=D0=B8=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D1=85=D0=B5=D0=B4=D0=B5=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sortList/sortList.c | 21 ++++++++++----------- sortList/sortList.h | 10 ++++++++++ 2 files changed, 20 insertions(+), 11 deletions(-) create mode 100644 sortList/sortList.h diff --git a/sortList/sortList.c b/sortList/sortList.c index f953787..43bf508 100644 --- a/sortList/sortList.c +++ b/sortList/sortList.c @@ -1,4 +1,4 @@ -#include +#include "sortList.h" #include #include @@ -14,19 +14,18 @@ typedef struct List { ListNode* head; } List; -// структура списка -ListNode* new(int value) +List* newList() { - ListNode* node = (ListNode*)malloc(sizeof(ListNode)); - node->value = value; - node->next = NULL; - return node; + List* list = { NULL }; + return list; } // положить элемент в соответствии с сортировкой void insert(List* list, int value) { - ListNode* newNode = new(value); + ListNode* newNode = (ListNode*)malloc(sizeof(ListNode)); + newNode->value = value; + newNode->next = NULL; // Если список пуст или новый элемент меньше головы if (list->head == NULL || value < list->head->value) { @@ -70,12 +69,12 @@ bool deleteNode(List* list, int value) // Если элемент не найден if (current->next == NULL) { - return 0; + return false; } // удаление элемента ListNode* temprery = current->next; - current->next = temprery->next; + current->next = current->next->next; free(temprery); return true; } @@ -101,4 +100,4 @@ void deleteList(List* list) free(temprery); } list->head = NULL; -} +} \ No newline at end of file diff --git a/sortList/sortList.h b/sortList/sortList.h new file mode 100644 index 0000000..b94db67 --- /dev/null +++ b/sortList/sortList.h @@ -0,0 +1,10 @@ +#pragma once +#include + +typedef struct List List; + +List* newList(); +void insert(List* list, int value); +bool deleteNode(List* list, int value); +void printList(List* list); +void deleteList(List* list); \ No newline at end of file From 3c7baa0dc3a07df7b4e3f1c410f6eca4606e166e Mon Sep 17 00:00:00 2001 From: Andrew-Kochanov Date: Sat, 20 Dec 2025 22:34:50 +0300 Subject: [PATCH 5/8] =?UTF-8?q?6=20=D0=B4=D0=BE=D0=BC=D0=B0=D1=88=D0=BD?= =?UTF-8?q?=D0=B5=D0=B5=20=D0=B7=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D1=81=D0=BE=D1=80=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=BE=D1=87?= =?UTF-8?q?=D0=BD=D1=8B=D0=B9=20=D1=81=D0=BF=D0=B8=D1=81=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hw.sortList/CMakeLists.txt | 19 +++++++++++++++++++ hw.sortList/main.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 hw.sortList/CMakeLists.txt create mode 100644 hw.sortList/main.c diff --git a/hw.sortList/CMakeLists.txt b/hw.sortList/CMakeLists.txt new file mode 100644 index 0000000..1fafe6c --- /dev/null +++ b/hw.sortList/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.25) +project(rewrite C) + +set(CMAKE_C_STANDARD 11) +set(CMAKE_C_STANDARD_REQUIRED ON) + +# Создаём библиотеку из файла в поддиректории +add_library(sortList sortList/sortList.c) + +# Создаём исполняемый файл из файла в другой поддиректории +add_executable(main hw.sort.List/main.c) + +# Линкуем библиотеку +target_link_libraries(main PRIVATE sortList) + +# Добавляем путь к заголовочным файлам библиотеки +target_include_directories(main PRIVATE + ${CMAKE_SOURCE_DIR}/sortList +) \ No newline at end of file diff --git a/hw.sortList/main.c b/hw.sortList/main.c new file mode 100644 index 0000000..aa670ba --- /dev/null +++ b/hw.sortList/main.c @@ -0,0 +1,38 @@ +#include "../sortList/sortList.h" +#include +#include +#include + +int main(int argc, char** argv) +{ + List* list = newList(); + int value = 0; + + printf("Ведите номер операции: 0 - выйти, 1 - добавить значение, 2 - удалить значение, 3 - распечатать список: "); + int operation = 0; + scanf("%d", &operation); + while (operation != 0) { + if (operation == 1) { + printf("Ведите, какое значение вставить: "); + scanf("%d", &value); + insert(list, value); + } else if (operation == 2) { + printf("Ведите, какое значение удалить: "); + scanf("%d", &value); + if (deleteNode(list, value)) { + printf("Элемент удален\n"); + } else { + printf("Удалить элемент невозможно\n"); + } + } else if (operation == 3) { + printList(list); + } else { + printf("Такой операции нет\n"); + } + printf("Ведите номер операции: 0 - выйти, 1 - добавить значение, 2 - удалить значение, 3 - распечатать список: "); + scanf("%d", &operation); + } + printf("Вы вышли\n"); + deleteList(list); + return 0; +} \ No newline at end of file From 00f3c593abd9de9402bdfa901c9fc8c89192f88a Mon Sep 17 00:00:00 2001 From: Andrew-Kochanov Date: Sat, 20 Dec 2025 22:57:45 +0300 Subject: [PATCH 6/8] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BB=D0=B8=D1=88=D0=BD=D0=B8=D0=B9=20=D1=84=D0=B0=D0=B9=D0=BB?= 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 | 14 - 3 files changed, 265 deletions(-) delete mode 100644 .CIclang/.clang-format delete mode 100644 .CIclang/.github/dependabot.yml delete mode 100644 .CIclang/.github/workflows/build-and-lint.yml diff --git a/.CIclang/.clang-format b/.CIclang/.clang-format deleted file mode 100644 index e2cbc59..0000000 --- a/.CIclang/.clang-format +++ /dev/null @@ -1,245 +0,0 @@ ---- -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 deleted file mode 100644 index 355e687..0000000 --- a/.CIclang/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -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 deleted file mode 100644 index a2c12fd..0000000 --- a/.CIclang/.github/workflows/build-and-lint.yml +++ /dev/null @@ -1,14 +0,0 @@ -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 From a7da279919def9bdced24c1b45b8aebca66bb298 Mon Sep 17 00:00:00 2001 From: Andrew-Kochanov Date: Sun, 21 Dec 2025 15:40:03 +0300 Subject: [PATCH 7/8] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D1=8E=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=20=D1=81=D0=BF=D0=B8=D1=81=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sortList/sortList.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sortList/sortList.c b/sortList/sortList.c index 43bf508..82f73bc 100644 --- a/sortList/sortList.c +++ b/sortList/sortList.c @@ -16,7 +16,8 @@ typedef struct List { List* newList() { - List* list = { NULL }; + List* list = (List*)malloc(sizeof(List)); + list->head = NULL; return list; } From 455ff2e0c0393de4ae8571a0549bdde9965fa6e7 Mon Sep 17 00:00:00 2001 From: Andrew-Kochanov Date: Sun, 21 Dec 2025 18:15:06 +0300 Subject: [PATCH 8/8] =?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=D0=BF=D0=B8=D1=81=D0=BA=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hw.sortList/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw.sortList/CMakeLists.txt b/hw.sortList/CMakeLists.txt index 1fafe6c..267037d 100644 --- a/hw.sortList/CMakeLists.txt +++ b/hw.sortList/CMakeLists.txt @@ -8,7 +8,7 @@ set(CMAKE_C_STANDARD_REQUIRED ON) add_library(sortList sortList/sortList.c) # Создаём исполняемый файл из файла в другой поддиректории -add_executable(main hw.sort.List/main.c) +add_executable(main hw.sortList/main.c) # Линкуем библиотеку target_link_libraries(main PRIVATE sortList)