aboutsummaryrefslogtreecommitdiff
path: root/.clang-format
diff options
context:
space:
mode:
authorViolet <violetshine@violetshine.net>2026-03-03 17:53:28 +0200
committerGitHub <noreply@github.com>2026-03-03 22:53:28 +0700
commit42bb19d4903ba5283c3a6d57690f8970c4a4e1da (patch)
treea38fbdfcdc430f9a8fd239810ff8067eb1e556a5 /.clang-format
parent1444581cb61e62cd71c855c278c840dd009149f0 (diff)
chore: add `.clang-format` based on the style 4J seemed to use (#30) (#273)
The style 4J used seems to be based on the Microsoft style (presumably the default settings of whatever Visual Studio they used to write this). However, the source files do not have much consistency so I highly doubt 4J cared too much about styling, just going with whatever happened to be the default. This style is therefore basically the Microsoft style (4-space indents, C#/Allman style braces) with some settings set based on my observations about the code. Fixes: #30
Diffstat (limited to '.clang-format')
-rw-r--r--.clang-format55
1 files changed, 55 insertions, 0 deletions
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 00000000..383e6210
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,55 @@
+---
+BasedOnStyle: Microsoft
+AccessModifierOffset: -2
+BraceWrapping:
+ AfterCaseLabel: false
+ AfterClass: true
+ AfterControlStatement: Always
+ AfterEnum: true
+ AfterExternBlock: true
+ AfterFunction: true
+ AfterNamespace: true
+ AfterObjCDeclaration: true
+ AfterStruct: true
+ AfterUnion: false
+ BeforeCatch: true
+ BeforeElse: true
+ BeforeLambdaBody: false
+ BeforeWhile: false
+ IndentBraces: false
+ SplitEmptyFunction: true
+ SplitEmptyRecord: true
+ SplitEmptyNamespace: true
+ColumnLimit: 0
+IncludeBlocks: Preserve
+IndentAccessModifiers: false
+IndentCaseBlocks: true
+IndentCaseLabels: false
+IndentExportBlock: true
+IndentExternBlock: AfterExternBlock
+IndentGotoLabels: false
+IndentPPDirectives: None
+IndentWidth: 4
+InsertBraces: true
+InsertNewlineAtEOF: true
+NamespaceIndentation: None
+PointerAlignment: Right
+RemoveParentheses: Leave
+RemoveSemicolon: false
+SeparateDefinitionBlocks: Leave
+ShortNamespaceLines: 1
+SkipMacroDefinitionBody: false
+SortIncludes:
+ Enabled: true
+ IgnoreCase: false
+SpacesInParens: Never
+SpacesInParensOptions:
+ ExceptDoubleParentheses: false
+ InCStyleCasts: false
+ InConditionalStatements: false
+ InEmptyParentheses: false
+ Other: false
+SpacesInSquareBrackets: false
+Standard: Latest
+TabWidth: 4
+UseTab: Never