Ver código fonte

Add Clang-Format configuration

This code style configuration is now the source of truth.
Patrick-Christopher Mattulat 1 ano atrás
pai
commit
a1a57c735e
2 arquivos alterados com 69 adições e 47 exclusões
  1. 69 0
      .clang-format
  2. 0 47
      config/lynar-studios-style.xml

+ 69 - 0
.clang-format

@@ -0,0 +1,69 @@
+# Generated from CLion C/C++ Code Style settings
+BasedOnStyle: LLVM
+AlignAfterOpenBracket: Align
+AlignConsecutiveAssignments: None
+AlignOperands: Align
+AllowAllArgumentsOnNextLine: false
+AllowAllConstructorInitializersOnNextLine: false
+AllowAllParametersOfDeclarationOnNextLine: false
+AllowShortBlocksOnASingleLine: Always
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: None
+AllowShortIfStatementsOnASingleLine: Never
+AllowShortLambdasOnASingleLine: All
+AllowShortLoopsOnASingleLine: true
+AlwaysBreakAfterReturnType: None
+AlwaysBreakTemplateDeclarations: Yes
+BreakBeforeBraces: Custom
+BraceWrapping:
+  AfterCaseLabel: false
+  AfterClass: true
+  AfterControlStatement: Always
+  AfterEnum: true
+  AfterFunction: true
+  AfterNamespace: true
+  AfterUnion: true
+  BeforeCatch: true
+  BeforeElse: true
+  IndentBraces: false
+  SplitEmptyFunction: false
+  SplitEmptyRecord: true
+BreakBeforeBinaryOperators: None
+BreakBeforeTernaryOperators: true
+BreakConstructorInitializers: BeforeColon
+BreakInheritanceList: BeforeColon
+ColumnLimit: 700
+CompactNamespaces: false
+ContinuationIndentWidth: 4
+EmptyLineAfterAccessModifier: Always
+FixNamespaceComments: false
+IndentAccessModifiers: true
+IndentCaseLabels: true
+IndentPPDirectives: BeforeHash
+IndentWidth: 2
+KeepEmptyLinesAtTheStartOfBlocks: true
+MaxEmptyLinesToKeep: 2
+NamespaceIndentation: All
+ObjCSpaceAfterProperty: false
+ObjCSpaceBeforeProtocolList: true
+PointerAlignment: Right
+ReflowComments: false
+SortIncludes: CaseSensitive
+SpaceAfterCStyleCast: true
+SpaceAfterLogicalNot: false
+SpaceAfterTemplateKeyword: false
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeCpp11BracedList: false
+SpaceBeforeCtorInitializerColon: true
+SpaceBeforeInheritanceColon: true
+SpaceBeforeParens: ControlStatements
+SpaceBeforeRangeBasedForLoopColon: false
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 0
+SpacesInAngles: false
+SpacesInCStyleCastParentheses: false
+SpacesInContainerLiterals: false
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+TabWidth: 2
+UseTab: Never

+ 0 - 47
config/lynar-studios-style.xml

@@ -1,47 +0,0 @@
-<code_scheme name="LynarStudiosStyle" version="173">
-  <HTMLCodeStyleSettings>
-    <option name="HTML_KEEP_LINE_BREAKS" value="false" />
-    <option name="HTML_KEEP_BLANK_LINES" value="4" />
-  </HTMLCodeStyleSettings>
-  <MarkdownNavigatorCodeStyleSettings>
-    <option name="RIGHT_MARGIN" value="72" />
-  </MarkdownNavigatorCodeStyleSettings>
-  <Objective-C>
-    <option name="INDENT_NAMESPACE_MEMBERS" value="2" />
-    <option name="INDENT_C_STRUCT_MEMBERS" value="2" />
-    <option name="INDENT_VISIBILITY_KEYWORDS" value="2" />
-    <option name="INDENT_INSIDE_CODE_BLOCK" value="2" />
-    <option name="INDENT_PREPROCESSOR_DIRECTIVE" value="2" />
-    <option name="INDENT_DIRECTIVE_AS_CODE" value="true" />
-    <option name="NAMESPACE_BRACE_PLACEMENT" value="2" />
-    <option name="FUNCTION_BRACE_PLACEMENT" value="2" />
-    <option name="BLOCK_BRACE_PLACEMENT" value="2" />
-    <option name="FUNCTION_CALL_ARGUMENTS_WRAP" value="0" />
-    <option name="CLASS_CONSTRUCTOR_INIT_LIST_WRAP" value="2" />
-  </Objective-C>
-  <Objective-C-extensions>
-    <extensions>
-      <pair source="cpp" header="hpp" fileNamingConvention="NONE" />
-      <pair source="c" header="h" fileNamingConvention="NONE" />
-    </extensions>
-  </Objective-C-extensions>
-  <codeStyleSettings language="HTML">
-    <indentOptions>
-      <option name="CONTINUATION_INDENT_SIZE" value="4" />
-    </indentOptions>
-  </codeStyleSettings>
-  <codeStyleSettings language="ObjectiveC">
-    <option name="RIGHT_MARGIN" value="700" />
-    <option name="KEEP_LINE_BREAKS" value="false" />
-    <option name="BLANK_LINES_AROUND_METHOD_IN_INTERFACE" value="0" />
-    <option name="BRACE_STYLE" value="2" />
-    <option name="CLASS_BRACE_STYLE" value="2" />
-    <option name="ELSE_ON_NEW_LINE" value="true" />
-    <option name="CATCH_ON_NEW_LINE" value="true" />
-    <indentOptions>
-      <option name="INDENT_SIZE" value="2" />
-      <option name="CONTINUATION_INDENT_SIZE" value="4" />
-      <option name="TAB_SIZE" value="2" />
-    </indentOptions>
-  </codeStyleSettings>
-</code_scheme>