Skip to content

Commit

Permalink
run updated clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
facontidavide committed Mar 8, 2024
1 parent 1bacc3f commit fa49fc4
Show file tree
Hide file tree
Showing 191 changed files with 25,074 additions and 23,795 deletions.
3 changes: 2 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: Never
ContinuationIndentWidth: 4
SortIncludes: false
SpaceAfterCStyleCast: false
Expand All @@ -61,7 +62,7 @@ BraceWrapping: {
AfterUnion : 'true',
BeforeCatch : 'true',
BeforeElse : 'true',
IndentBraces : 'false'
IndentBraces : 'false',
SplitEmptyFunction: 'false'
}
...
9 changes: 4 additions & 5 deletions .github/workflows/cmake_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main
with:
version: 1.59.0

- name: Create default profile
run: conan profile new default --detect

Expand All @@ -50,11 +50,10 @@ jobs:
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake --build . --config ${{env.BUILD_TYPE}}

- name: run test (Linux)
working-directory: ${{github.workspace}}/build
run: ./tests/behaviortree_cpp_test

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3

7 changes: 3 additions & 4 deletions .github/workflows/cmake_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main
with:
version: 1.59.0

- name: Create default profile
run: conan profile new default --detect

Expand All @@ -47,8 +47,7 @@ jobs:
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config ${{env.BUILD_TYPE}}

- name: run test (Windows)
working-directory: ${{github.workspace}}/build
run: $env:PATH+=";${{env.BUILD_TYPE}}"; tests/${{env.BUILD_TYPE}}/behaviortree_cpp_test.exe

6 changes: 1 addition & 5 deletions .github/workflows/pixi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,4 @@ jobs:
working-directory: ${{github.workspace}}/build-env
run: |
pixi task add tests ${{ matrix.tests_command }}
pixi run tests

pixi run tests
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#
# See https://github.com/pre-commit/pre-commit

exclude: ^3rdparty/|3rdparty
exclude: ^3rdparty/|3rdparty|^include/behaviortree_cpp/contrib/
repos:

# Standard hooks
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,3 @@ INSTALL( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
FILES_MATCHING PATTERN "*.h*")

export_btcpp_package()

1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

30 changes: 15 additions & 15 deletions cmake/conan.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ macro(_conan_detect_compiler)
set(COMPILER_VERSION ${MAJOR})
else()
set(COMPILER_VERSION ${MAJOR}.${MINOR})
endif()
endif()
elseif (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL QCC)
set(_CONAN_SETTING_COMPILER qcc)
set(COMPILER_VERSION ${MAJOR}.${MINOR})
Expand Down Expand Up @@ -180,7 +180,7 @@ macro(_conan_detect_compiler)
set(COMPILER_VERSION ${MAJOR})
else()
set(COMPILER_VERSION ${MAJOR}.${MINOR})
endif()
endif()

set(_CONAN_SETTING_COMPILER_VERSION ${COMPILER_VERSION})

Expand All @@ -190,7 +190,7 @@ macro(_conan_detect_compiler)
set(_CONAN_SETTING_COMPILER_LIBCXX ${_LIBCXX})
endif ()
elseif (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL Clang
AND NOT "${CMAKE_${LANGUAGE}_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC"
AND NOT "${CMAKE_${LANGUAGE}_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC"
AND NOT "${CMAKE_${LANGUAGE}_SIMULATE_ID}" STREQUAL "MSVC")

string(REPLACE "." ";" VERSION_LIST ${CMAKE_${LANGUAGE}_COMPILER_VERSION})
Expand All @@ -203,7 +203,7 @@ macro(_conan_detect_compiler)
set(COMPILER_VERSION ${MAJOR})
else()
set(COMPILER_VERSION ${MAJOR}.${MINOR})
endif()
endif()

set(_CONAN_SETTING_COMPILER_VERSION ${COMPILER_VERSION})

Expand All @@ -219,8 +219,8 @@ macro(_conan_detect_compiler)
set(_CONAN_SETTING_COMPILER_LIBCXX ${_LIBCXX})
endif ()
elseif(${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL MSVC
OR (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL Clang
AND "${CMAKE_${LANGUAGE}_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC"
OR (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL Clang
AND "${CMAKE_${LANGUAGE}_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC"
AND "${CMAKE_${LANGUAGE}_SIMULATE_ID}" STREQUAL "MSVC"))

set(_VISUAL "Visual Studio")
Expand Down Expand Up @@ -475,7 +475,7 @@ function(conan_cmake_autodetect detected_settings)
endfunction()

macro(conan_parse_arguments)
set(options BASIC_SETUP CMAKE_TARGETS UPDATE KEEP_RPATHS NO_LOAD NO_OUTPUT_DIRS
set(options BASIC_SETUP CMAKE_TARGETS UPDATE KEEP_RPATHS NO_LOAD NO_OUTPUT_DIRS
OUTPUT_QUIET NO_IMPORTS SKIP_STD)
set(oneValueArgs CONANFILE ARCH BUILD_TYPE INSTALL_FOLDER OUTPUT_FOLDER CONAN_COMMAND)
set(multiValueArgs DEBUG_PROFILE RELEASE_PROFILE RELWITHDEBINFO_PROFILE MINSIZEREL_PROFILE
Expand Down Expand Up @@ -656,11 +656,11 @@ function(conan_cmake_install)
if(DEFINED NO_IMPORTS)
set(NO_IMPORTS --no-imports)
endif()
set(install_args install ${PATH_OR_REFERENCE} ${REFERENCE} ${UPDATE} ${NO_IMPORTS} ${REMOTE}
${LOCKFILE} ${LOCKFILE_OUT} ${LOCKFILE_NODE_ID} ${INSTALL_FOLDER}
${OUTPUT_FOLDER} ${GENERATOR} ${BUILD} ${ENV} ${ENV_HOST} ${ENV_BUILD}
${OPTIONS} ${OPTIONS_HOST} ${OPTIONS_BUILD} ${PROFILE} ${PROFILE_HOST}
${PROFILE_BUILD} ${SETTINGS} ${SETTINGS_HOST} ${SETTINGS_BUILD}
set(install_args install ${PATH_OR_REFERENCE} ${REFERENCE} ${UPDATE} ${NO_IMPORTS} ${REMOTE}
${LOCKFILE} ${LOCKFILE_OUT} ${LOCKFILE_NODE_ID} ${INSTALL_FOLDER}
${OUTPUT_FOLDER} ${GENERATOR} ${BUILD} ${ENV} ${ENV_HOST} ${ENV_BUILD}
${OPTIONS} ${OPTIONS_HOST} ${OPTIONS_BUILD} ${PROFILE} ${PROFILE_HOST}
${PROFILE_BUILD} ${SETTINGS} ${SETTINGS_HOST} ${SETTINGS_BUILD}
${CONF} ${CONF_HOST} ${CONF_BUILD})

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

string(REPLACE ";" " " _lock_create_Args "${lock_create_Args}")
message(STATUS "Conan executing: ${CONAN_CMD} ${_lock_create_Args}")

if(ARGS_OUTPUT_QUIET)
set(OUTPUT_OPT OUTPUT_QUIET)
endif()
Expand Down Expand Up @@ -1083,7 +1083,7 @@ function(conan_cmake_profile)
set(profileMultiValueArgs SETTINGS OPTIONS CONF ENV BUILDENV RUNENV TOOL_REQUIRES)
cmake_parse_arguments(ARGS "" "${profileOneValueArgs}" "${profileMultiValueArgs}" ${ARGN})

if(DEFINED ARGS_FILEPATH)
if(DEFINED ARGS_FILEPATH)
set(_FN "${ARGS_FILEPATH}")
else()
set(_FN "${CMAKE_CURRENT_BINARY_DIR}/profile")
Expand Down
1 change: 0 additions & 1 deletion contributors.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Davide Faconti
Michele Colledanchise
Rocco Santomo

2 changes: 1 addition & 1 deletion convert_v3_to_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,4 @@ class ArgsType(typing.NamedTuple):


if __name__ == "__main__":
main()
main()
26 changes: 13 additions & 13 deletions docs/substitution_sample.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"TestNodeConfigs": {
"MyTest": {
"async_delay": 2000,
"return_status": "SUCCESS",
"post_script": "msg ='message SUBSTITUED'"
}
},

"SubstitutionRules": {
"mysub/action_*": "TestAction",
"talk": "TestSaySomething",
"last_action": "MyTest"
"TestNodeConfigs": {
"MyTest": {
"async_delay": 2000,
"return_status": "SUCCESS",
"post_script": "msg ='message SUBSTITUED'"
}
}
},

"SubstitutionRules": {
"mysub/action_*": "TestAction",
"talk": "TestSaySomething",
"last_action": "MyTest"
}
}
4 changes: 2 additions & 2 deletions examples/broken_sequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ActionTestNode : public ActionNode
time_ = 5;
stop_loop_ = false;
int i = 0;
while (!stop_loop_ && i++ < time_)
while(!stop_loop_ && i++ < time_)
{
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
Expand Down Expand Up @@ -51,7 +51,7 @@ int main()

NodeStatus status = NodeStatus::RUNNING;

while (status == NodeStatus::RUNNING)
while(status == NodeStatus::RUNNING)
{
status = root.executeTick();

Expand Down
8 changes: 4 additions & 4 deletions examples/ex01_wrap_legacy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MyLegacyMoveTo
bool go(Point3D goal)
{
printf("Going to: %f %f %f\n", goal.x, goal.y, goal.z);
return true; // true means success in my legacy code
return true; // true means success in my legacy code
}
};

Expand All @@ -33,7 +33,7 @@ Point3D convertFromString(StringView key)
{
// three real numbers separated by semicolons
auto parts = BT::splitString(key, ';');
if (parts.size() != 3)
if(parts.size() != 3)
{
throw RuntimeError("invalid input)");
}
Expand All @@ -46,7 +46,7 @@ Point3D convertFromString(StringView key)
return output;
}
}
} // namespace BT
} // namespace BT

// clang-format off
static const char* xml_text = R"(
Expand Down Expand Up @@ -81,7 +81,7 @@ int main()

// Register the lambda with BehaviorTreeFactory::registerSimpleAction

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

auto tree = factory.createTreeFromText(xml_text);
Expand Down
14 changes: 7 additions & 7 deletions examples/ex02_runtime_ports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ static const char* xml_text = R"(
class ThinkRuntimePort : public BT::SyncActionNode
{
public:
ThinkRuntimePort(const std::string& name, const BT::NodeConfig& config) :
BT::SyncActionNode(name, config)
ThinkRuntimePort(const std::string& name, const BT::NodeConfig& config)
: BT::SyncActionNode(name, config)
{}

BT::NodeStatus tick() override
Expand All @@ -31,15 +31,15 @@ class ThinkRuntimePort : public BT::SyncActionNode
class SayRuntimePort : public BT::SyncActionNode
{
public:
SayRuntimePort(const std::string& name, const BT::NodeConfig& config) :
BT::SyncActionNode(name, config)
SayRuntimePort(const std::string& name, const BT::NodeConfig& config)
: BT::SyncActionNode(name, config)
{}

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

//-------- register ports that might be defined at runtime --------
// more verbose way
PortsList think_ports = {BT::OutputPort<std::string>("text")};
PortsList think_ports = { BT::OutputPort<std::string>("text") };
factory.registerBuilder(
CreateManifest<ThinkRuntimePort>("ThinkRuntimePort", think_ports),
CreateBuilder<ThinkRuntimePort>());
// less verbose way
PortsList say_ports = {BT::InputPort<std::string>("message")};
PortsList say_ports = { BT::InputPort<std::string>("message") };
factory.registerNodeType<SayRuntimePort>("SayRuntimePort", say_ports);

factory.registerBehaviorTreeFromText(xml_text);
Expand Down
Loading

0 comments on commit fa49fc4

Please sign in to comment.