format code (editorconfig and clang-format)
This commit is contained in:
parent
11c0cbbdb0
commit
1e3c68054f
4 changed files with 117 additions and 40 deletions
66
.clang-format
Normal file
66
.clang-format
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
---
|
||||||
|
BasedOnStyle: Google
|
||||||
|
AccessModifierOffset: -2
|
||||||
|
ConstructorInitializerIndentWidth: 2
|
||||||
|
AlignEscapedNewlinesLeft: false
|
||||||
|
AlignTrailingComments: true
|
||||||
|
AllowAllParametersOfDeclarationOnNextLine: false
|
||||||
|
AllowShortIfStatementsOnASingleLine: false
|
||||||
|
AllowShortLoopsOnASingleLine: false
|
||||||
|
AllowShortFunctionsOnASingleLine: None
|
||||||
|
AllowShortLoopsOnASingleLine: false
|
||||||
|
AlwaysBreakTemplateDeclarations: true
|
||||||
|
AlwaysBreakBeforeMultilineStrings: false
|
||||||
|
BreakBeforeBinaryOperators: false
|
||||||
|
BreakBeforeTernaryOperators: false
|
||||||
|
BreakConstructorInitializersBeforeComma: true
|
||||||
|
BinPackParameters: true
|
||||||
|
ColumnLimit: 120
|
||||||
|
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||||
|
DerivePointerBinding: false
|
||||||
|
PointerBindsToType: true
|
||||||
|
ExperimentalAutoDetectBinPacking: false
|
||||||
|
IndentCaseLabels: true
|
||||||
|
MaxEmptyLinesToKeep: 1
|
||||||
|
NamespaceIndentation: None
|
||||||
|
ObjCSpaceBeforeProtocolList: true
|
||||||
|
PenaltyBreakBeforeFirstCallParameter: 19
|
||||||
|
PenaltyBreakComment: 60
|
||||||
|
PenaltyBreakString: 1
|
||||||
|
PenaltyBreakFirstLessLess: 1000
|
||||||
|
PenaltyExcessCharacter: 1000
|
||||||
|
PenaltyReturnTypeOnItsOwnLine: 90
|
||||||
|
SpacesBeforeTrailingComments: 2
|
||||||
|
Cpp11BracedListStyle: false
|
||||||
|
Standard: Auto
|
||||||
|
IndentWidth: 3
|
||||||
|
TabWidth: 3
|
||||||
|
UseTab: Never
|
||||||
|
IndentFunctionDeclarationAfterType: false
|
||||||
|
SpacesInParentheses: true
|
||||||
|
SpacesInAngles: false
|
||||||
|
SpaceInEmptyParentheses: false
|
||||||
|
SpacesInCStyleCastParentheses: false
|
||||||
|
SpaceAfterControlStatementKeyword: true
|
||||||
|
SpaceBeforeAssignmentOperators: true
|
||||||
|
ContinuationIndentWidth: 4
|
||||||
|
SortIncludes: false
|
||||||
|
SpaceAfterCStyleCast: false
|
||||||
|
|
||||||
|
# Configure each individual brace in BraceWrapping
|
||||||
|
BreakBeforeBraces: Custom
|
||||||
|
|
||||||
|
# Control of individual brace wrapping cases
|
||||||
|
BraceWrapping: {
|
||||||
|
AfterClass: 'true'
|
||||||
|
AfterControlStatement: 'false'
|
||||||
|
AfterEnum : 'true'
|
||||||
|
AfterFunction : 'false'
|
||||||
|
AfterNamespace : 'true'
|
||||||
|
AfterStruct : 'true'
|
||||||
|
AfterUnion : 'true'
|
||||||
|
BeforeCatch : 'true'
|
||||||
|
BeforeElse : 'true'
|
||||||
|
IndentBraces : 'false'
|
||||||
|
}
|
||||||
|
...
|
11
.editorconfig
Normal file
11
.editorconfig
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 3
|
||||||
|
tab_width = 3
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
max_line_length = 120
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -6,3 +6,6 @@ doku/*.pdf
|
||||||
doku/*.gz
|
doku/*.gz
|
||||||
doku/*.toc
|
doku/*.toc
|
||||||
doku/*.log
|
doku/*.log
|
||||||
|
|
||||||
|
# Ignore Visual Studio Code folder
|
||||||
|
.vscode/
|
||||||
|
|
|
@ -14,7 +14,6 @@ using namespace std;
|
||||||
using namespace ros;
|
using namespace ros;
|
||||||
using namespace wlan_pioneer;
|
using namespace wlan_pioneer;
|
||||||
|
|
||||||
|
|
||||||
int8_t getWlanSignalStrength( const string& interface ) {
|
int8_t getWlanSignalStrength( const string& interface ) {
|
||||||
struct iw_statistics stats;
|
struct iw_statistics stats;
|
||||||
struct iwreq req;
|
struct iwreq req;
|
||||||
|
@ -36,13 +35,11 @@ int8_t getWlanSignalStrength(const string &interface) {
|
||||||
ROS_ERROR( "Error retrieving WLAN signal strength " );
|
ROS_ERROR( "Error retrieving WLAN signal strength " );
|
||||||
close( sockfd );
|
close( sockfd );
|
||||||
return numeric_limits<int8_t>::min();
|
return numeric_limits<int8_t>::min();
|
||||||
|
|
||||||
}
|
}
|
||||||
close( sockfd );
|
close( sockfd );
|
||||||
return stats.qual.level;
|
return stats.qual.level;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main( int argc, char** argv ) {
|
int main( int argc, char** argv ) {
|
||||||
init( argc, argv, "wlanSignal" );
|
init( argc, argv, "wlanSignal" );
|
||||||
NodeHandle node;
|
NodeHandle node;
|
||||||
|
|
Loading…
Reference in a new issue