Skip to content

Format using google style#98

Open
costashatz wants to merge 1 commit intoethz-adrl:masterfrom
NOSALRO:format_google_style
Open

Format using google style#98
costashatz wants to merge 1 commit intoethz-adrl:masterfrom
NOSALRO:format_google_style

Conversation

@costashatz
Copy link
Copy Markdown

Similar to ethz-adrl/ifopt#90, this PR is applying the actual Google Style to all cpp files as mentioned in the CONTRIBUTING.md file.

For reference I used the following clang-format arguments:

{"Language": "Cpp", "BasedOnStyle": "Google", "AccessModifierOffset": -1, "AlignAfterOpenBracket": "Align", "AlignConsecutiveAssignments": true, "AlignOperands": "Align", "AllowAllArgumentsOnNextLine": true, "AllowAllConstructorInitializersOnNextLine": true, "AllowAllParametersOfDeclarationOnNextLine": false, "AllowShortBlocksOnASingleLine": "Empty", "AllowShortCaseLabelsOnASingleLine": false, "AllowShortFunctionsOnASingleLine": "Inline", "AllowShortIfStatementsOnASingleLine": "Never", "AllowShortLambdasOnASingleLine": "Inline", "AllowShortLoopsOnASingleLine": false, "AlwaysBreakAfterReturnType": "None", "AlwaysBreakTemplateDeclarations": "Yes", "BinPackArguments": true, "BreakBeforeBraces": "Custom", "BraceWrapping": {"AfterCaseLabel": false, "AfterClass": false, "AfterStruct": false, "AfterControlStatement": "Never", "AfterEnum": false, "AfterFunction": true, "AfterNamespace": false, "AfterUnion": false, "AfterExternBlock": false, "BeforeCatch": false, "BeforeElse": false, "BeforeLambdaBody": false, "IndentBraces": false, "SplitEmptyFunction": false, "SplitEmptyRecord": false, "SplitEmptyNamespace": false}, "BreakBeforeBinaryOperators": "None", "BreakBeforeTernaryOperators": true, "BreakConstructorInitializers": "BeforeColon", "BreakInheritanceList": "BeforeColon", "ColumnLimit": 80, "CompactNamespaces": false, "ContinuationIndentWidth": 4, "Cpp11BracedListStyle": true, "DerivePointerAlignment": false, "EmptyLineBeforeAccessModifier": "LogicalBlock", "FixNamespaceComments": true, "IncludeBlocks": "Preserve", "IndentCaseLabels": true, "IndentPPDirectives": "None", "IndentWidth": 2, "KeepEmptyLinesAtTheStartOfBlocks": true, "MaxEmptyLinesToKeep": 1, "NamespaceIndentation": "None", "ObjCSpaceAfterProperty": false, "ObjCSpaceBeforeProtocolList": true, "PointerAlignment": "Left", "ReflowComments": false, "SpaceAfterCStyleCast": false, "SpaceAfterLogicalNot": false, "SpaceAfterTemplateKeyword": true, "SpaceBeforeAssignmentOperators": true, "SpaceBeforeCpp11BracedList": false, "SpaceBeforeCtorInitializerColon": true, "SpaceBeforeInheritanceColon": true, "SpaceBeforeParens": "ControlStatements", "SpaceBeforeRangeBasedForLoopColon": true, "SpaceBeforeSquareBrackets": false, "SpaceInEmptyParentheses": false, "SpacesBeforeTrailingComments": 2, "SpacesInAngles": false, "SpacesInCStyleCastParentheses": false, "SpacesInContainerLiterals": false, "SpacesInParentheses": false, "SpacesInSquareBrackets": false, "Standard": "c++11", "TabWidth": 4, "UseTab": "Never"}

I copy-paste this into vscode's clang-format integration and get automatic formatting :)

@costashatz
Copy link
Copy Markdown
Author

@awinkler @disRecord any updates on this? Thanks..

@costashatz
Copy link
Copy Markdown
Author

@awinkler @disRecord any updates? Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant