Skip to content

Instantly share code, notes, and snippets.

@sritasngh
Last active August 17, 2021 10:12
Show Gist options
  • Save sritasngh/7c31db973914f8fc25243654e1de0cad to your computer and use it in GitHub Desktop.
Save sritasngh/7c31db973914f8fc25243654e1de0cad to your computer and use it in GitHub Desktop.
---
BasedOnStyle: Microsoft
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: 'true'
AlignEscapedNewlines: DontAlign
AlignTrailingComments: 'true'
AllowAllConstructorInitializersOnNextLine: 'true'
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AlwaysBreakBeforeMultilineStrings: 'true'
BreakConstructorInitializers: AfterColon
ColumnLimit: '80'
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
IncludeBlocks: Regroup
IndentWidth: '2'
Language: Cpp
NamespaceIndentation: All
PointerAlignment: Left
ReflowComments: 'true'
SortIncludes: 'true'
SortUsingDeclarations: 'true'
SpaceAfterLogicalNot: 'false'
SpaceAfterTemplateKeyword: 'false'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeCpp11BracedList: 'true'
SpaceBeforeCtorInitializerColon: 'true'
SpaceBeforeInheritanceColon: 'true'
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: 'true'
SpaceInEmptyParentheses: 'false'
SpacesBeforeTrailingComments: '1'
SpacesInAngles: 'false'
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
Standard: Cpp11
UseTab: Never
...
@sritasngh
Copy link
Author

sritasngh commented Aug 17, 2021

You can test this with vscode:

  • Import this file to the root directory of FOSSology project
  • select a block of code or file and format in vs code

To use this file with terminal

  • please use this command clang-format --style=file -i
  • Here -style=file is used to load style configuration from .clang-format file located in one of the parent directories of the source file (or current directory for stdin).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment