Skip to content

Commit

Permalink
Update clang-format-10 format
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Jan 26, 2021
1 parent 04a5636 commit 22c9b1c
Show file tree
Hide file tree
Showing 1,583 changed files with 12,829 additions and 15,230 deletions.
242 changes: 154 additions & 88 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,99 +1,165 @@
###############################################################################
# Mobile Robot Programming Toolkit (MRPT)
# https://www.mrpt.org/
#
###############################################################################

# For all the available options - and taking in account the version of
# clang-format see the following links:
#
# More accurate if we know the version in advance
# http://releases.llvm.org/3.8.0/tools/clang/docs/ClangFormatStyleOptions.html
#
# Holds a general list of keys - may not be applicable for our version though
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html

---
Language: Cpp
BasedOnStyle: Google
# ---
#AccessModifierOffset: -4
AlignAfterOpenBracket: AlwaysBreak # Values: Align, DontAlign, AlwaysBreak
#AlignConsecutiveAssignments: true
#AlignConsecutiveDeclarations: true
#AlignEscapedNewlinesLeft: true
#AlignOperands: false
AlignTrailingComments: false # Should be off, causes many dummy problems!!
#AllowAllParametersOfDeclarationOnNextLine: true
#AllowShortBlocksOnASingleLine: false
#AllowShortCaseLabelsOnASingleLine: false
#AllowShortFunctionsOnASingleLine: Empty
#AllowShortIfStatementsOnASingleLine: false
#AllowShortLoopsOnASingleLine: false
#AlwaysBreakAfterDefinitionReturnType: None
#AlwaysBreakAfterReturnType: None
#AlwaysBreakBeforeMultilineStrings: true
#AlwaysBreakTemplateDeclarations: true
#BinPackArguments: false
#BinPackParameters: false
#BraceWrapping:
#AfterClass: false
#AfterControlStatement: false
#AfterEnum: false
#AfterFunction: false
#AfterNamespace: false
#AfterObjCDeclaration: false
#AfterStruct: false
#AfterUnion: false
#BeforeCatch: false
#BeforeElse: true
#IndentBraces: false
#BreakBeforeBinaryOperators: None
AccessModifierOffset: -1
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveMacros: false
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: false
AlignTrailingComments: false
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Always
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Allman
#BreakBeforeTernaryOperators: true
#BreakConstructorInitializersBeforeComma: false
ColumnLimit: 80
#CommentPragmas: ''
#ConstructorInitializerAllOnOneLineOrOnePerLine: true
#ConstructorInitializerIndentWidth: 4
#ContinuationIndentWidth: 4
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
#DerivePointerAlignment: false
#DisableFormat: false
#ExperimentalAutoDetectBinPacking: false
##FixNamespaceComments: true # Not applicable in 3.8
#ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
#IncludeCategories:
#- Regex: '.*'
#Priority: 1
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<ext/.*\.h>'
Priority: 2
SortPriority: 0
- Regex: '^<.*\.h>'
Priority: 1
SortPriority: 0
- Regex: '^<.*'
Priority: 2
SortPriority: 0
- Regex: '.*'
Priority: 3
SortPriority: 0
IncludeIsMainRegex: '([-_](test|unittest))?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: true
IndentGotoLabels: true
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: true
#KeepEmptyLinesAtTheStartOfBlocks: true
#MacroBlockBegin: ''
#MacroBlockEnd: ''
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
#PenaltyBreakBeforeFirstCallParameter: 19
#PenaltyBreakComment: 300
#PenaltyBreakFirstLessLess: 120
#PenaltyBreakString: 1000
#PenaltyExcessCharacter: 1000000
#PenaltyReturnTypeOnItsOwnLine: 200
DerivePointerAlignment: false
#PointerAlignment: Left
ReflowComments: true # Should be true, otherwise clang-format doesn't touch comments
ObjCBinPackProtocolList: Never
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
RawStringFormats:
- Language: Cpp
Delimiters:
- cc
- CC
- cpp
- Cpp
- CPP
- 'c++'
- 'C++'
CanonicalDelimiter: ''
BasedOnStyle: google
- Language: TextProto
Delimiters:
- pb
- PB
- proto
- PROTO
EnclosingFunctions:
- EqualsProto
- EquivToProto
- PARSE_PARTIAL_TEXT_PROTO
- PARSE_TEST_PROTO
- PARSE_TEXT_PROTO
- ParseTextOrDie
- ParseTextProtoOrDie
CanonicalDelimiter: ''
BasedOnStyle: google
ReflowComments: true
SortIncludes: true
#SpaceAfterCStyleCast: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
#SpaceBeforeParens: ControlStatements
#SpaceInEmptyParentheses: false
#SpacesBeforeTrailingComments: 2
#SpacesInAngles: false
#SpacesInContainerLiterals: true
#SpacesInCStyleCastParentheses: false
#SpacesInParentheses: false
#SpacesInSquareBrackets: false
Standard: Cpp11
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
Standard: Latest
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 4
UseTab: Always # Available options are Never, Always, ForIndentation
#---
UseCRLF: false
UseTab: Always
...
9 changes: 5 additions & 4 deletions apps/2d-slam-demo/CDlgParams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
+------------------------------------------------------------------------+ */

#include "CDlgParams.h"

#include "slamdemoMain.h"

//(*InternalHeaders(CDlgParams)
Expand Down Expand Up @@ -258,8 +259,8 @@ CDlgParams::CDlgParams(
_T("ID_PANEL1"));
FlexGridSizer9 = new wxFlexGridSizer(0, 2, 0, 0);
FlexGridSizer9->AddGrowableCol(0);
wxString __wxRadioBoxChoices_1[2] = {_("Mahalanobis"),
_("Matching likelihood")};
wxString __wxRadioBoxChoices_1[2] = {
_("Mahalanobis"), _("Matching likelihood")};
rbICmetric = new wxRadioBox(
panelDA, ID_RADIOBOX3, _("Indiv. compat. gating"), wxDefaultPosition,
wxDefaultSize, 2, __wxRadioBoxChoices_1, 1, wxRA_VERTICAL,
Expand Down Expand Up @@ -296,8 +297,8 @@ CDlgParams::CDlgParams(
FlexGridSizer9->Add(
rbDAMethod, 1, wxALL | wxEXPAND | wxALIGN_LEFT | wxALIGN_TOP, 5);
FlexGridSizer9->Add(-1, -1, 1, wxALL | wxALIGN_LEFT | wxALIGN_TOP, 5);
wxString __wxRadioBoxChoices_3[2] = {_("Mahalanobis"),
_("Matching likelihood")};
wxString __wxRadioBoxChoices_3[2] = {
_("Mahalanobis"), _("Matching likelihood")};
rbDAMetric = new wxRadioBox(
panelDA, ID_RADIOBOX2, _("D.A. Distance measure "), wxDefaultPosition,
wxDefaultSize, 2, __wxRadioBoxChoices_3, 1, wxRA_VERTICAL,
Expand Down
4 changes: 2 additions & 2 deletions apps/2d-slam-demo/CLogView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
| Released under BSD License. See: https://www.mrpt.org/License |
+------------------------------------------------------------------------+ */

#include "CLogView.h"

#include "slamdemoApp.h" // These are just to avoid weird WX compile issues with UNICODE, etc..
#include "slamdemoMain.h"

#include "CLogView.h"

//(*InternalHeaders(CLogView)
#include <wx/font.h>
#include <wx/intl.h>
Expand Down
5 changes: 4 additions & 1 deletion apps/2d-slam-demo/batch_experiments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
#include <mrpt/math/wrap2pi.h>
#include <wx/image.h>
#include <wx/msgdlg.h>

#include <fstream>

#include "slamdemoApp.h"
#include "slamdemoMain.h"

Expand Down Expand Up @@ -45,7 +47,8 @@ void slamdemoApp::DoBatchExperiments(const std::string& cfgFil)
tim.Tic();

if (!m_option_norun)
for (size_t i = 0; i < nSteps; i++) win->executeOneStep();
for (size_t i = 0; i < nSteps; i++)
win->executeOneStep();

double mT = tim.Tac();

Expand Down
4 changes: 3 additions & 1 deletion apps/2d-slam-demo/slamdemoApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

//(*AppHeaders
#include <wx/image.h>

#include "slamdemoMain.h"
//*)
#include <wx/msgdlg.h>
Expand Down Expand Up @@ -102,7 +103,8 @@ bool slamdemoApp::doCommandLineProcess()
bool res_parse = cmd.parse(argc, &auxArgs[0]);

// Free aux mem:
for (int i = 0; i < argc; i++) delete[] auxArgs[i];
for (int i = 0; i < argc; i++)
delete[] auxArgs[i];

if (!res_parse)
{
Expand Down
2 changes: 1 addition & 1 deletion apps/2d-slam-demo/slamdemoApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ class slamdemoApp : public wxApp
bool m_option_norun;
};

#endif // SLAMDEMOAPP_H
#endif // SLAMDEMOAPP_H
Loading

0 comments on commit 22c9b1c

Please sign in to comment.