Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
---
BasedOnStyle: Google
DerivePointerAlignment: false
IncludeBlocks: Regroup
IncludeCategories:
# Headers in "" with extension.
- Regex: '"([A-Za-z0-9.\Q/-_\E])+"'
Priority: 1
# Headers in <> without extension.
- Regex: '<([A-Za-z0-9\Q/-_\E])+>'
Priority: 2
# Headers in <> from specific external libraries.
- Regex: '<(catch2|boost|rclcpp.*)\/'
Priority: 3
# Headers in <> with extension.
- Regex: '<([A-Za-z0-9.\Q/-_\E])+>'
Priority: 4
IncludeBlocks: Preserve
InsertBraces: true
---
20 changes: 3 additions & 17 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This is a format job. Pre-commit has a first-party GitHub action, so we use
# that: https://github.com/pre-commit/action

name: Format

on:
Expand All @@ -12,17 +9,6 @@ on:

jobs:
pre-commit:
name: pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
- name: Install clang-format
run: sudo apt-get install clang-format
- uses: pre-commit/action@v3.0.1
id: precommit
- name: Upload pre-commit changes
if: failure() && steps.precommit.outcome == 'failure'
uses: rhaschke/upload-git-patch-action@main
with:
name: pre-commit
uses: ros-controls/ros2_control_ci/.github/workflows/reusable-pre-commit.yml@master
with:
ros_distro: rolling
29 changes: 29 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ repos:
- id: check-vcs-permalinks
- id: check-yaml
exclude: generate_parameter_library_py/generate_parameter_library_py/test
args: ["--allow-multiple-documents"]
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
Expand Down Expand Up @@ -75,3 +76,31 @@ repos:
rev: v3.21.2
hooks:
- id: pyupgrade

- repo: local
hooks:
- id: ament_cppcheck
name: ament_cppcheck
description: Static code analysis of C/C++ files.
entry: env AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS=1 ament_cppcheck
language: system
files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
- id: ament_cpplint
name: ament_cpplint
description: Static code analysis of C/C++ files.
entry: ament_cpplint
language: system
files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
args: ["--linelength=100", "--filter=-whitespace/newline"]
- id: ament_lint_cmake
name: ament_lint_cmake
description: Check format of CMakeLists.txt files.
entry: ament_lint_cmake
language: system
files: CMakeLists\.txt$
- id: ament_copyright
name: ament_copyright
description: Check if copyright notice is available in all files.
entry: ament_copyright
language: system
exclude: .*/conf\.py$
6 changes: 0 additions & 6 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ rclcpp_components_register_node(minimal_publisher
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
set(ament_cmake_cpplint_FOUND TRUE) # Conflicts with clang-foramt
set(ament_cmake_flake8_FOUND TRUE) # Conflicts with black
set(ament_cmake_uncrustify_FOUND TRUE) # Conflicts with clang-format
ament_lint_auto_find_test_dependencies()

find_package(ament_cmake_gtest REQUIRED)
# example_test_gtest
add_rostest_with_parameters_gtest(test_example_gtest test/example_test_gtest.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@

#pragma once

#include <fmt/core.h>

#include <string>

#include <rclcpp/rclcpp.hpp>

#include <fmt/core.h>
#include <tl_expected/expected.hpp>

namespace custom_validators {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

#pragma once

#include <memory>

#include <rclcpp/rclcpp.hpp>
#include <rclcpp_components/register_node_macro.hpp>

Expand All @@ -37,7 +39,8 @@ namespace admittance_controller {

class MinimalPublisher : public rclcpp::Node {
public:
MinimalPublisher(const rclcpp::NodeOptions& options = rclcpp::NodeOptions());
explicit MinimalPublisher(
const rclcpp::NodeOptions& options = rclcpp::NodeOptions());

private:
void timer_callback();
Expand Down
3 changes: 0 additions & 3 deletions example/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@

<buildtool_export_depend>ament_cmake_core</buildtool_export_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
Expand Down
6 changes: 3 additions & 3 deletions example/test/descriptor_test_gtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
// Author: Chance Cardona
//

#include <limits>
#include <memory>

#include "generate_parameter_library_example/admittance_controller_parameters.hpp"
#include "gtest/gtest.h"
#include "rclcpp/rclcpp.hpp"

#include <limits>
#include <memory>

class DescriptorTest : public ::testing::Test {
public:
void SetUp() {
Expand Down
4 changes: 2 additions & 2 deletions example/test/example_test_gmock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
// Author: Denis Štogl
//

#include <memory>

#include "generate_parameter_library_example/admittance_controller_parameters.hpp"
#include "gmock/gmock.h"
#include "rclcpp/rclcpp.hpp"

#include <memory>

class ExampleTest : public ::testing::Test {
public:
void SetUp() {
Expand Down
4 changes: 2 additions & 2 deletions example/test/example_test_gtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
// Author: Denis Štogl
//

#include <memory>

#include "generate_parameter_library_example/admittance_controller_parameters.hpp"
#include "gtest/gtest.h"
#include "rclcpp/rclcpp.hpp"

#include <memory>

class ExampleTest : public ::testing::Test {
public:
void SetUp() {
Expand Down
3 changes: 0 additions & 3 deletions example_cmake_python/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@

<buildtool_depend>ament_cmake_python</buildtool_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
Expand Down
8 changes: 0 additions & 8 deletions example_external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,4 @@ install(
ament_export_targets(export_generate_parameter_library_example_external HAS_LIBRARY_TARGET)
ament_export_dependencies(rclcpp rclcpp_components generate_parameter_library_example)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
set(ament_cmake_cpplint_FOUND TRUE) # Conflicts with clang-foramt
set(ament_cmake_flake8_FOUND TRUE) # Conflicts with black
set(ament_cmake_uncrustify_FOUND TRUE) # Conflicts with clang-format
ament_lint_auto_find_test_dependencies()
endif()

ament_package()
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@
// Copyright 2025 Forssea Robotics
//
// All rights reserved.
//
// Software License Agreement (BSD License 2.0)
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of the Forssea Robotics nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
// * Neither the name of the Forssea Robotics nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

#pragma once
Expand Down
3 changes: 0 additions & 3 deletions example_external/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@

<buildtool_export_depend>ament_cmake_core</buildtool_export_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
Expand Down
46 changes: 21 additions & 25 deletions example_external/src/minimal_publisher_external.cpp
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@
// Copyright 2025 Forssea Robotics
//
// All rights reserved.
//
// Software License Agreement (BSD License 2.0)
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of the Forssea Robotics nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
// * Neither the name of the Forssea Robotics nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

#include "generate_parameter_library_example_external/minimal_publisher_external.hpp"
Expand Down
3 changes: 0 additions & 3 deletions example_python/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
<depend>generate_parameter_library_py</depend>
<depend>rclpy</depend>

<test_depend>ament_copyright</test_depend>
<test_depend>ament_flake8</test_depend>
<test_depend>ament_pep257</test_depend>
<test_depend>python3-pytest</test_depend>

<export>
Expand Down
30 changes: 30 additions & 0 deletions example_python/setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
#!/usr/bin/env python3

# Copyright 2023 PickNik Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of the PickNik Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

import sys

from setuptools import setup
Expand Down
Loading
Loading