Skip to content

Instantly share code, notes, and snippets.

@NovaSurfer
Last active July 3, 2019 20:52
Show Gist options
  • Select an option

  • Save NovaSurfer/0fd28e06c7aacff3fd2ccf6b90cdda81 to your computer and use it in GitHub Desktop.

Select an option

Save NovaSurfer/0fd28e06c7aacff3fd2ccf6b90cdda81 to your computer and use it in GitHub Desktop.

Revisions

  1. NovaSurfer revised this gist Jul 3, 2019. 1 changed file with 1 addition and 4 deletions.
    5 changes: 1 addition & 4 deletions .clang-format
    Original file line number Diff line number Diff line change
    @@ -22,7 +22,7 @@ AllowAllParametersOfDeclarationOnNextLine: true
    AllowShortBlocksOnASingleLine: false
    AllowShortCaseLabelsOnASingleLine: false
    AllowShortFunctionsOnASingleLine: Empty
    AllowShortIfStatementsOnASingleLine: true
    AllowShortIfStatementsOnASingleLine: false
    AllowShortLoopsOnASingleLine: false
    AlwaysBreakAfterDefinitionReturnType: false
    AlwaysBreakAfterReturnType: None
    @@ -60,7 +60,6 @@ ConstructorInitializerAllOnOneLineOrOnePerLine: false
    ConstructorInitializerIndentWidth: 4
    ContinuationIndentWidth: 4
    Cpp11BracedListStyle: true
    SpaceBeforeCpp11BracedList: false
    DerivePointerAlignment: false
    ExperimentalAutoDetectBinPacking: false
    ForEachMacros: ['RANGES_FOR', 'FOREACH']
    @@ -72,7 +71,6 @@ MacroBlockBegin: ''
    MacroBlockEnd: ''
    MaxEmptyLinesToKeep: 1
    NamespaceIndentation: All
    SpaceBeforeRangeBasedForLoopColon: false
    PenaltyBreakBeforeFirstCallParameter: 19
    PenaltyBreakComment: 300
    PenaltyBreakFirstLessLess: 120
    @@ -92,7 +90,6 @@ SpacesInCStyleCastParentheses: false
    SpacesInParentheses: false
    SpacesInSquareBrackets: false
    SpaceAfterTemplateKeyword: true
    SpaceBeforeInheritanceColon: true

    ReflowComments: false
    IncludeBlocks: Preserve
  2. NovaSurfer revised this gist Jul 3, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion .clang-format
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    BasedOnStyle: WebKit
    TabWidth: 4
    IndentWidth: 4
    UseTab: Always
    UseTab: Never
    ColumnLimit: 100

    ---
  3. NovaSurfer created this gist Jul 3, 2019.
    99 changes: 99 additions & 0 deletions .clang-format
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,99 @@
    # Common settings
    BasedOnStyle: WebKit
    TabWidth: 4
    IndentWidth: 4
    UseTab: Always
    ColumnLimit: 100

    ---
    Language: Cpp

    DisableFormat: false
    Standard: Cpp11

    AccessModifierOffset: -4
    AlignAfterOpenBracket: true
    AlignConsecutiveAssignments: false
    AlignConsecutiveDeclarations: false
    AlignEscapedNewlinesLeft: false
    AlignOperands: true
    AlignTrailingComments: false
    AllowAllParametersOfDeclarationOnNextLine: true
    AllowShortBlocksOnASingleLine: false
    AllowShortCaseLabelsOnASingleLine: false
    AllowShortFunctionsOnASingleLine: Empty
    AllowShortIfStatementsOnASingleLine: true
    AllowShortLoopsOnASingleLine: false
    AlwaysBreakAfterDefinitionReturnType: false
    AlwaysBreakAfterReturnType: None
    AlwaysBreakBeforeMultilineStrings: false
    AlwaysBreakTemplateDeclarations: true
    BinPackArguments: true
    BinPackParameters: true

    BreakBeforeBraces: Custom
    BraceWrapping: {
    AfterClass: 'true'
    AfterControlStatement: 'false'
    AfterEnum : 'true'
    AfterFunction : 'true'
    AfterNamespace : 'true'
    AfterStruct : 'true'
    AfterUnion : 'true'
    BeforeCatch : 'true'
    BeforeElse : 'false'
    IndentBraces : 'false'
    AfterExternBlock : 'true'
    SplitEmptyFunction : 'false'
    SplitEmptyRecord : 'false'
    SplitEmptyNamespace : 'true'
    }

    BreakBeforeInheritanceComma: false
    BreakBeforeBinaryOperators: None
    BreakBeforeTernaryOperators: true
    BreakConstructorInitializersBeforeComma: true
    BreakStringLiterals: true

    CompactNamespaces: false
    ConstructorInitializerAllOnOneLineOrOnePerLine: false
    ConstructorInitializerIndentWidth: 4
    ContinuationIndentWidth: 4
    Cpp11BracedListStyle: true
    SpaceBeforeCpp11BracedList: false
    DerivePointerAlignment: false
    ExperimentalAutoDetectBinPacking: false
    ForEachMacros: ['RANGES_FOR', 'FOREACH']
    IndentCaseLabels: false
    FixNamespaceComments: false
    IndentWrappedFunctionNames: false
    KeepEmptyLinesAtTheStartOfBlocks: true
    MacroBlockBegin: ''
    MacroBlockEnd: ''
    MaxEmptyLinesToKeep: 1
    NamespaceIndentation: All
    SpaceBeforeRangeBasedForLoopColon: false
    PenaltyBreakBeforeFirstCallParameter: 19
    PenaltyBreakComment: 300
    PenaltyBreakFirstLessLess: 120
    PenaltyBreakString: 1000

    PenaltyExcessCharacter: 1000000
    PenaltyReturnTypeOnItsOwnLine: 60
    PointerAlignment: Left
    SpaceAfterCStyleCast: false
    SpaceBeforeAssignmentOperators: true
    SpaceBeforeParens: Never
    SpaceInEmptyParentheses: false
    SpacesBeforeTrailingComments: 1
    SpacesInAngles: false
    SpacesInContainerLiterals: true
    SpacesInCStyleCastParentheses: false
    SpacesInParentheses: false
    SpacesInSquareBrackets: false
    SpaceAfterTemplateKeyword: true
    SpaceBeforeInheritanceColon: true

    ReflowComments: false
    IncludeBlocks: Preserve
    IndentPPDirectives: AfterHash