Skip to content

Commit fa49fc4

Browse files
committed
run updated clang-format
1 parent 1bacc3f commit fa49fc4

File tree

191 files changed

+25074
-23795
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+25074
-23795
lines changed

.clang-format

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ SpaceInEmptyParentheses: false
4242
SpacesInCStyleCastParentheses: false
4343
SpaceAfterControlStatementKeyword: true
4444
SpaceBeforeAssignmentOperators: true
45+
SpaceBeforeParens: Never
4546
ContinuationIndentWidth: 4
4647
SortIncludes: false
4748
SpaceAfterCStyleCast: false
@@ -61,7 +62,7 @@ BraceWrapping: {
6162
AfterUnion : 'true',
6263
BeforeCatch : 'true',
6364
BeforeElse : 'true',
64-
IndentBraces : 'false'
65+
IndentBraces : 'false',
6566
SplitEmptyFunction: 'false'
6667
}
6768
...

.github/workflows/cmake_ubuntu.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ jobs:
1919

2020
steps:
2121
- uses: actions/checkout@v2
22-
22+
2323
- name: Install Conan
2424
id: conan
2525
uses: turtlebrowser/get-conan@main
2626
with:
2727
version: 1.59.0
28-
28+
2929
- name: Create default profile
3030
run: conan profile new default --detect
3131

@@ -50,11 +50,10 @@ jobs:
5050
shell: bash
5151
working-directory: ${{github.workspace}}/build
5252
run: cmake --build . --config ${{env.BUILD_TYPE}}
53-
53+
5454
- name: run test (Linux)
5555
working-directory: ${{github.workspace}}/build
5656
run: ./tests/behaviortree_cpp_test
57-
57+
5858
- name: Upload coverage reports to Codecov
5959
uses: codecov/codecov-action@v3
60-

.github/workflows/cmake_windows.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ jobs:
1919

2020
steps:
2121
- uses: actions/checkout@v2
22-
22+
2323
- name: Install Conan
2424
id: conan
2525
uses: turtlebrowser/get-conan@main
2626
with:
2727
version: 1.59.0
28-
28+
2929
- name: Create default profile
3030
run: conan profile new default --detect
3131

@@ -47,8 +47,7 @@ jobs:
4747
working-directory: ${{github.workspace}}/build
4848
shell: bash
4949
run: cmake --build . --config ${{env.BUILD_TYPE}}
50-
50+
5151
- name: run test (Windows)
5252
working-directory: ${{github.workspace}}/build
5353
run: $env:PATH+=";${{env.BUILD_TYPE}}"; tests/${{env.BUILD_TYPE}}/behaviortree_cpp_test.exe
54-

.github/workflows/pixi.yaml

+1-5
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,4 @@ jobs:
5151
working-directory: ${{github.workspace}}/build-env
5252
run: |
5353
pixi task add tests ${{ matrix.tests_command }}
54-
pixi run tests
55-
56-
57-
58-
54+
pixi run tests

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#
1414
# See https://github.com/pre-commit/pre-commit
1515

16-
exclude: ^3rdparty/|3rdparty
16+
exclude: ^3rdparty/|3rdparty|^include/behaviortree_cpp/contrib/
1717
repos:
1818

1919
# Standard hooks

CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,3 @@ INSTALL( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
220220
FILES_MATCHING PATTERN "*.h*")
221221

222222
export_btcpp_package()
223-

LICENSE

-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
22-

cmake/conan.cmake

+15-15
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ macro(_conan_detect_compiler)
146146
set(COMPILER_VERSION ${MAJOR})
147147
else()
148148
set(COMPILER_VERSION ${MAJOR}.${MINOR})
149-
endif()
149+
endif()
150150
elseif (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL QCC)
151151
set(_CONAN_SETTING_COMPILER qcc)
152152
set(COMPILER_VERSION ${MAJOR}.${MINOR})
@@ -180,7 +180,7 @@ macro(_conan_detect_compiler)
180180
set(COMPILER_VERSION ${MAJOR})
181181
else()
182182
set(COMPILER_VERSION ${MAJOR}.${MINOR})
183-
endif()
183+
endif()
184184

185185
set(_CONAN_SETTING_COMPILER_VERSION ${COMPILER_VERSION})
186186

@@ -190,7 +190,7 @@ macro(_conan_detect_compiler)
190190
set(_CONAN_SETTING_COMPILER_LIBCXX ${_LIBCXX})
191191
endif ()
192192
elseif (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL Clang
193-
AND NOT "${CMAKE_${LANGUAGE}_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC"
193+
AND NOT "${CMAKE_${LANGUAGE}_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC"
194194
AND NOT "${CMAKE_${LANGUAGE}_SIMULATE_ID}" STREQUAL "MSVC")
195195

196196
string(REPLACE "." ";" VERSION_LIST ${CMAKE_${LANGUAGE}_COMPILER_VERSION})
@@ -203,7 +203,7 @@ macro(_conan_detect_compiler)
203203
set(COMPILER_VERSION ${MAJOR})
204204
else()
205205
set(COMPILER_VERSION ${MAJOR}.${MINOR})
206-
endif()
206+
endif()
207207

208208
set(_CONAN_SETTING_COMPILER_VERSION ${COMPILER_VERSION})
209209

@@ -219,8 +219,8 @@ macro(_conan_detect_compiler)
219219
set(_CONAN_SETTING_COMPILER_LIBCXX ${_LIBCXX})
220220
endif ()
221221
elseif(${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL MSVC
222-
OR (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL Clang
223-
AND "${CMAKE_${LANGUAGE}_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC"
222+
OR (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL Clang
223+
AND "${CMAKE_${LANGUAGE}_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC"
224224
AND "${CMAKE_${LANGUAGE}_SIMULATE_ID}" STREQUAL "MSVC"))
225225

226226
set(_VISUAL "Visual Studio")
@@ -475,7 +475,7 @@ function(conan_cmake_autodetect detected_settings)
475475
endfunction()
476476

477477
macro(conan_parse_arguments)
478-
set(options BASIC_SETUP CMAKE_TARGETS UPDATE KEEP_RPATHS NO_LOAD NO_OUTPUT_DIRS
478+
set(options BASIC_SETUP CMAKE_TARGETS UPDATE KEEP_RPATHS NO_LOAD NO_OUTPUT_DIRS
479479
OUTPUT_QUIET NO_IMPORTS SKIP_STD)
480480
set(oneValueArgs CONANFILE ARCH BUILD_TYPE INSTALL_FOLDER OUTPUT_FOLDER CONAN_COMMAND)
481481
set(multiValueArgs DEBUG_PROFILE RELEASE_PROFILE RELWITHDEBINFO_PROFILE MINSIZEREL_PROFILE
@@ -656,11 +656,11 @@ function(conan_cmake_install)
656656
if(DEFINED NO_IMPORTS)
657657
set(NO_IMPORTS --no-imports)
658658
endif()
659-
set(install_args install ${PATH_OR_REFERENCE} ${REFERENCE} ${UPDATE} ${NO_IMPORTS} ${REMOTE}
660-
${LOCKFILE} ${LOCKFILE_OUT} ${LOCKFILE_NODE_ID} ${INSTALL_FOLDER}
661-
${OUTPUT_FOLDER} ${GENERATOR} ${BUILD} ${ENV} ${ENV_HOST} ${ENV_BUILD}
662-
${OPTIONS} ${OPTIONS_HOST} ${OPTIONS_BUILD} ${PROFILE} ${PROFILE_HOST}
663-
${PROFILE_BUILD} ${SETTINGS} ${SETTINGS_HOST} ${SETTINGS_BUILD}
659+
set(install_args install ${PATH_OR_REFERENCE} ${REFERENCE} ${UPDATE} ${NO_IMPORTS} ${REMOTE}
660+
${LOCKFILE} ${LOCKFILE_OUT} ${LOCKFILE_NODE_ID} ${INSTALL_FOLDER}
661+
${OUTPUT_FOLDER} ${GENERATOR} ${BUILD} ${ENV} ${ENV_HOST} ${ENV_BUILD}
662+
${OPTIONS} ${OPTIONS_HOST} ${OPTIONS_BUILD} ${PROFILE} ${PROFILE_HOST}
663+
${PROFILE_BUILD} ${SETTINGS} ${SETTINGS_HOST} ${SETTINGS_BUILD}
664664
${CONF} ${CONF_HOST} ${CONF_BUILD})
665665

666666
string(REPLACE ";" " " _install_args "${install_args}")
@@ -764,12 +764,12 @@ function(conan_cmake_lock_create)
764764
set(BASE --base)
765765
endif()
766766
set(lock_create_Args lock create ${PATH} ${REFERENCE} ${UPDATE} ${BASE} ${REMOTE} ${LOCKFILE} ${LOCKFILE_OUT} ${LOCKFILE_NODE_ID} ${INSTALL_FOLDER}
767-
${GENERATOR} ${BUILD} ${ENV} ${ENV_HOST} ${ENV_BUILD} ${OPTIONS} ${OPTIONS_HOST} ${OPTIONS_BUILD}
767+
${GENERATOR} ${BUILD} ${ENV} ${ENV_HOST} ${ENV_BUILD} ${OPTIONS} ${OPTIONS_HOST} ${OPTIONS_BUILD}
768768
${PROFILE} ${PROFILE_HOST} ${PROFILE_BUILD} ${SETTINGS} ${SETTINGS_HOST} ${SETTINGS_BUILD})
769769

770770
string(REPLACE ";" " " _lock_create_Args "${lock_create_Args}")
771771
message(STATUS "Conan executing: ${CONAN_CMD} ${_lock_create_Args}")
772-
772+
773773
if(ARGS_OUTPUT_QUIET)
774774
set(OUTPUT_OPT OUTPUT_QUIET)
775775
endif()
@@ -1083,7 +1083,7 @@ function(conan_cmake_profile)
10831083
set(profileMultiValueArgs SETTINGS OPTIONS CONF ENV BUILDENV RUNENV TOOL_REQUIRES)
10841084
cmake_parse_arguments(ARGS "" "${profileOneValueArgs}" "${profileMultiValueArgs}" ${ARGN})
10851085

1086-
if(DEFINED ARGS_FILEPATH)
1086+
if(DEFINED ARGS_FILEPATH)
10871087
set(_FN "${ARGS_FILEPATH}")
10881088
else()
10891089
set(_FN "${CMAKE_CURRENT_BINARY_DIR}/profile")

contributors.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
Davide Faconti
22
Michele Colledanchise
33
Rocco Santomo
4-

convert_v3_to_v4.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,4 +170,4 @@ class ArgsType(typing.NamedTuple):
170170

171171

172172
if __name__ == "__main__":
173-
main()
173+
main()

docs/substitution_sample.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"TestNodeConfigs": {
3-
"MyTest": {
4-
"async_delay": 2000,
5-
"return_status": "SUCCESS",
6-
"post_script": "msg ='message SUBSTITUED'"
7-
}
8-
},
9-
10-
"SubstitutionRules": {
11-
"mysub/action_*": "TestAction",
12-
"talk": "TestSaySomething",
13-
"last_action": "MyTest"
2+
"TestNodeConfigs": {
3+
"MyTest": {
4+
"async_delay": 2000,
5+
"return_status": "SUCCESS",
6+
"post_script": "msg ='message SUBSTITUED'"
147
}
15-
}
8+
},
9+
10+
"SubstitutionRules": {
11+
"mysub/action_*": "TestAction",
12+
"talk": "TestSaySomething",
13+
"last_action": "MyTest"
14+
}
15+
}

examples/broken_sequence.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ActionTestNode : public ActionNode
2121
time_ = 5;
2222
stop_loop_ = false;
2323
int i = 0;
24-
while (!stop_loop_ && i++ < time_)
24+
while(!stop_loop_ && i++ < time_)
2525
{
2626
std::this_thread::sleep_for(std::chrono::milliseconds(100));
2727
}
@@ -51,7 +51,7 @@ int main()
5151

5252
NodeStatus status = NodeStatus::RUNNING;
5353

54-
while (status == NodeStatus::RUNNING)
54+
while(status == NodeStatus::RUNNING)
5555
{
5656
status = root.executeTick();
5757

examples/ex01_wrap_legacy.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class MyLegacyMoveTo
2020
bool go(Point3D goal)
2121
{
2222
printf("Going to: %f %f %f\n", goal.x, goal.y, goal.z);
23-
return true; // true means success in my legacy code
23+
return true; // true means success in my legacy code
2424
}
2525
};
2626

@@ -33,7 +33,7 @@ Point3D convertFromString(StringView key)
3333
{
3434
// three real numbers separated by semicolons
3535
auto parts = BT::splitString(key, ';');
36-
if (parts.size() != 3)
36+
if(parts.size() != 3)
3737
{
3838
throw RuntimeError("invalid input)");
3939
}
@@ -46,7 +46,7 @@ Point3D convertFromString(StringView key)
4646
return output;
4747
}
4848
}
49-
} // namespace BT
49+
} // namespace BT
5050

5151
// clang-format off
5252
static const char* xml_text = R"(
@@ -81,7 +81,7 @@ int main()
8181

8282
// Register the lambda with BehaviorTreeFactory::registerSimpleAction
8383

84-
PortsList ports = {BT::InputPort<Point3D>("goal")};
84+
PortsList ports = { BT::InputPort<Point3D>("goal") };
8585
factory.registerSimpleAction("MoveTo", MoveToWrapperWithLambda, ports);
8686

8787
auto tree = factory.createTreeFromText(xml_text);

examples/ex02_runtime_ports.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ static const char* xml_text = R"(
1717
class ThinkRuntimePort : public BT::SyncActionNode
1818
{
1919
public:
20-
ThinkRuntimePort(const std::string& name, const BT::NodeConfig& config) :
21-
BT::SyncActionNode(name, config)
20+
ThinkRuntimePort(const std::string& name, const BT::NodeConfig& config)
21+
: BT::SyncActionNode(name, config)
2222
{}
2323

2424
BT::NodeStatus tick() override
@@ -31,15 +31,15 @@ class ThinkRuntimePort : public BT::SyncActionNode
3131
class SayRuntimePort : public BT::SyncActionNode
3232
{
3333
public:
34-
SayRuntimePort(const std::string& name, const BT::NodeConfig& config) :
35-
BT::SyncActionNode(name, config)
34+
SayRuntimePort(const std::string& name, const BT::NodeConfig& config)
35+
: BT::SyncActionNode(name, config)
3636
{}
3737

3838
// You must override the virtual function tick()
3939
BT::NodeStatus tick() override
4040
{
4141
auto msg = getInput<std::string>("message");
42-
if (!msg)
42+
if(!msg)
4343
{
4444
throw BT::RuntimeError("missing required input [message]: ", msg.error());
4545
}
@@ -54,12 +54,12 @@ int main()
5454

5555
//-------- register ports that might be defined at runtime --------
5656
// more verbose way
57-
PortsList think_ports = {BT::OutputPort<std::string>("text")};
57+
PortsList think_ports = { BT::OutputPort<std::string>("text") };
5858
factory.registerBuilder(
5959
CreateManifest<ThinkRuntimePort>("ThinkRuntimePort", think_ports),
6060
CreateBuilder<ThinkRuntimePort>());
6161
// less verbose way
62-
PortsList say_ports = {BT::InputPort<std::string>("message")};
62+
PortsList say_ports = { BT::InputPort<std::string>("message") };
6363
factory.registerNodeType<SayRuntimePort>("SayRuntimePort", say_ports);
6464

6565
factory.registerBehaviorTreeFromText(xml_text);

0 commit comments

Comments
 (0)