From 57b077a4788b7fb5ed6add1df4ba3f15c9e6349b Mon Sep 17 00:00:00 2001 From: Filip Wandzio Date: Sun, 1 Mar 2026 11:33:21 +0100 Subject: Add editor configs and formatter rules Signed-off-by: Filip Wandzio --- .clang-format | 31 +++++++++++++++++++++++++++++++ .editorconfig | 22 ++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .clang-format create mode 100644 .editorconfig diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..670c9d1 --- /dev/null +++ b/.clang-format @@ -0,0 +1,31 @@ +Language: C +BasedOnStyle: LLVM +AccessModifierOffset: -4 +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: Left +AlignOperands: true +AlignTrailingComments: true +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: InlineOnly +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterReturnType: None +BinPackArguments: false +BinPackParameters: false +BreakBeforeBinaryOperators: NonAssignment +BreakBeforeBraces: Linux +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: true +ColumnLimit: 80 +ConstructorInitializerAllOnOneLineOrOnePerLine: true +DerivePointerAlignment: false +IndentCaseLabels: true +IndentWidth: 8 +KeepEmptyLinesAtTheStartOfBlocks: false +PointerAlignment: Left +SpacesBeforeTrailingComments: 1 +TabWidth: 8 +UseTab: Always diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e3a3965 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,22 @@ +# EditorConfig dla Embedded C Project +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +max_line_length = 80 + +[*.c] +indent_style = tab +indent_size = 8 + +[*.h] +indent_style = tab +indent_size = 8 + +[Makefile] +indent_style = tab +indent_size = 8 +max_line_length = 120 -- cgit v1.2.3