aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2023-10-07 12:03:55 +0200
committerFelix Morgner <felix.morgner@ost.ch>2023-10-07 12:03:55 +0200
commit84f03c4870af20c9edf16343f968f3b920c04a02 (patch)
treec545917174d20ef6d129193e309543b26ef6bf3b
parentc46c48d2acbcd7c74a93be6c5348fc4c6a8a646d (diff)
downloadteachos-84f03c4870af20c9edf16343f968f3b920c04a02.tar.xz
teachos-84f03c4870af20c9edf16343f968f3b920c04a02.zip
source: add clang formatter configuration
-rw-r--r--source/.clang-format77
-rw-r--r--source/kernel/arch/x86_64/src/entry.cpp7
2 files changed, 81 insertions, 3 deletions
diff --git a/source/.clang-format b/source/.clang-format
new file mode 100644
index 0000000..fbcf7e4
--- /dev/null
+++ b/source/.clang-format
@@ -0,0 +1,77 @@
+---
+AccessModifierOffset: '-2'
+AlignAfterOpenBracket: Align
+AlignConsecutiveAssignments: 'false'
+AlignConsecutiveDeclarations: 'false'
+AlignEscapedNewlines: Left
+AlignOperands: 'true'
+AlignTrailingComments: 'false'
+AllowAllParametersOfDeclarationOnNextLine: 'true'
+AllowShortBlocksOnASingleLine: 'false'
+AllowShortCaseLabelsOnASingleLine: 'false'
+AllowShortFunctionsOnASingleLine: All
+AllowShortIfStatementsOnASingleLine: 'false'
+AllowShortLoopsOnASingleLine: 'false'
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakTemplateDeclarations: 'true'
+BinPackArguments: 'true'
+BinPackParameters: 'true'
+BreakBeforeBraces: Custom
+BraceWrapping:
+ AfterClass: 'true'
+ AfterControlStatement: 'true'
+ AfterEnum: 'true'
+ AfterFunction: 'true'
+ AfterNamespace: 'true'
+ AfterStruct: 'true'
+ AfterUnion: 'true'
+ AfterExternBlock: 'true'
+ BeforeCatch: 'true'
+ BeforeElse: 'true'
+ IndentBraces: 'false'
+BreakBeforeInheritanceComma: 'false'
+BreakConstructorInitializers: BeforeComma
+BreakStringLiterals: 'true'
+ColumnLimit: '120'
+CompactNamespaces: 'false'
+Cpp11BracedListStyle: 'true'
+DerivePointerAlignment: 'false'
+FixNamespaceComments: 'true'
+IncludeBlocks: Regroup
+IncludeCategories:
+ # Local Headers
+ - Regex: '"(.*/)+/.+\.hpp"'
+ Priority: 100
+ # STL Headers
+ - Regex: '<[[:alnum:]._]+(?!\.(h|hpp))>'
+ Priority: 400
+ # C Library Headers
+ - Regex: '<([[:alnum:]._]/*)+\.h>'
+ Priority: 300
+IndentCaseLabels: 'true'
+IndentPPDirectives: None
+IndentWidth: '2'
+KeepEmptyLinesAtTheStartOfBlocks: 'false'
+Language: Cpp
+MaxEmptyLinesToKeep: '1'
+NamespaceIndentation: All
+PointerAlignment: Middle
+ReflowComments: 'true'
+SortIncludes: 'true'
+SortUsingDeclarations: 'true'
+SpaceAfterCStyleCast: 'false'
+SpaceAfterTemplateKeyword: 'false'
+SpaceBeforeAssignmentOperators: 'true'
+SpaceBeforeParens: ControlStatements
+SpaceInEmptyParentheses: 'false'
+SpacesBeforeTrailingComments: '2'
+SpacesInAngles: 'false'
+SpacesInContainerLiterals: 'false'
+SpacesInCStyleCastParentheses: 'false'
+SpacesInParentheses: 'false'
+SpacesInSquareBrackets: 'false'
+Standard: Cpp11
+TabWidth: '2'
+UseTab: Never
+...
diff --git a/source/kernel/arch/x86_64/src/entry.cpp b/source/kernel/arch/x86_64/src/entry.cpp
index 0daf227..2d4e7fb 100644
--- a/source/kernel/arch/x86_64/src/entry.cpp
+++ b/source/kernel/arch/x86_64/src/entry.cpp
@@ -2,8 +2,9 @@ namespace teachos
{
extern "C" auto kernel_main() -> void
{
- while(true) {
- asm volatile ("nop");
+ while (true)
+ {
+ asm volatile("nop");
}
}
-}
+} // namespace teachos