diff --git a/.clang-format b/.clang-format index a786624..fe3ed65 100644 --- a/.clang-format +++ b/.clang-format @@ -1,4 +1,7 @@ --- +# SPDX-FileCopyrightText: Copyright DB Netz AG +# SPDX-License-Identifier: CC0-1.0 + Language: Cpp AccessModifierOffset: -4 AlignAfterOpenBracket: DontAlign diff --git a/.clang-tidy b/.clang-tidy index 5edb2ee..e539e35 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,4 +1,7 @@ --- +# SPDX-FileCopyrightText: Copyright DB Netz AG +# SPDX-License-Identifier: CC0-1.0 + # google-readability-avoid-underscore-in-googletest-name: The rationale behind this is explained in the GTest FAQ. Basically, it avoids illegal or duplicated names created by GTest based on the inputs to TEST_F. # -readability-function-size, -readability-function-cognitive-complexity: Disabled because our functions are too complex at the moment and refactoring needs to be done separately. # -modernize-concat-nested-namespaces: We don't actually use C++17 yet, so we need to disable C++17 fixes. diff --git a/.cmake-format.py b/.cmake-format.py index 2727415..201575f 100644 --- a/.cmake-format.py +++ b/.cmake-format.py @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: Copyright DB Netz AG +# SPDX-License-Identifier: Apache-2.0 + # ---------------------------------- # Options affecting listfile parsing # ---------------------------------- diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6e126f9..8d958de 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,7 @@ +--- # SPDX-FileCopyrightText: Copyright DB Netz AG # SPDX-License-Identifier: CC0-1.0 ---- name: Rail Horizon CI on: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 63a0e21..96b0f5f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,16 +1,83 @@ +--- # SPDX-FileCopyrightText: Copyright DB Netz AG # SPDX-License-Identifier: CC0-1.0 ---- repos: + - repo: https://github.com/Lucas-C/pre-commit-hooks + rev: v1.5.1 + hooks: + - id: insert-license + name: Insert license headers (Markdown) + args: + - --detect-license-in-X-top-lines=15 + - --license-filepath + - LICENSES/.license_header_cc0.txt + - --comment-style + - + types_or: [markdown] + files: '' + - id: insert-license + name: Insert license headers (XML) + args: + - --detect-license-in-X-top-lines=15 + - --license-filepath + - LICENSES/.license_header_cc0.txt + - --insert-license-after-regex + - ^<\?xml.*\?> + - --comment-style + - + types_or: [xml] + files: '' + - id: insert-license + name: Insert license headers (C, C++) + args: + - --detect-license-in-X-top-lines=15 + - --license-filepath + - LICENSES/.license_header.txt + - --comment-style + - /*| *| */ + types_or: [c, c++] + files: '' + - id: insert-license + name: Insert license headers (Python) + args: + - --detect-license-in-X-top-lines=15 + - --license-filepath + - LICENSES/.license_header.txt + - --comment-style + - '#' + types_or: [python] + files: '' + - id: insert-license + name: Insert license headers (CMake, Shell) + args: + - --detect-license-in-X-top-lines=15 + - --license-filepath + - LICENSES/.license_header_cc0.txt + - --comment-style + - '#' + types_or: [gitmodules, gitignore, cmake, shell] + files: '' + - id: insert-license + name: Insert license headers (YAML) + args: + - --detect-license-in-X-top-lines=15 + - --license-filepath + - LICENSES/.license_header_cc0.txt + - --insert-license-after-regex + - ^---$ + - --comment-style + - '#' + types_or: [yaml] + files: '' - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.4.0 hooks: - id: mixed-line-ending args: [--fix=lf] - id: trailing-whitespace - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt - rev: 0.2.2 + rev: 0.2.3 hooks: - id: yamlfmt - repo: https://github.com/pre-commit/mirrors-yapf @@ -35,49 +102,6 @@ repos: # verbose: true - id: cmake-lint exclude: CPM.cmake - - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.4.2 - hooks: - - id: insert-license - name: Insert license headers (shell-style comments) - files: (?:^|/)(?:.*\.(?:sh|toml|ya?ml|cmake)|\.((?:git|helm|docker)(ignore|modules)|.clang-format|Doxyfile.in)|CMakeLists.txt)$ - # exclude: '(?:^|/)\..+|^docs/Makefile$' - args: - - --detect-license-in-X-top-lines=15 - - --license-filepath - - LICENSES/.license_header_cc0.txt - - --comment-style - - '#' - - id: insert-license - name: Insert license headers (XML-style comments) - files: \.(?:html|md|xml)$ - exclude: (?:^|/)\..+ - args: - - --detect-license-in-X-top-lines=15 - - --license-filepath - - LICENSES/.license_header_cc0.txt - - --comment-style - - - - id: insert-license - name: Insert license headers (C-style comments) - files: \.(?:cpp|h|proto)$ - exclude: (?:^|/)\..+ - args: - - --detect-license-in-X-top-lines=15 - - --license-filepath - - LICENSES/.license_header.txt - - --comment-style - - /*| *| */ - - id: insert-license - name: Insert license headers (C-style comments) - files: \.(?:py)$ - exclude: (?:^|/)\..+ - args: - - --detect-license-in-X-top-lines=15 - - --license-filepath - - LICENSES/.license_header.txt - - --comment-style - - '#' - repo: local hooks: - id: include-what-you-use diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 56f5bef..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,87 +0,0 @@ -# SPDX-FileCopyrightText: Copyright DB Netz AG -# SPDX-License-Identifier: CC0-1.0 - ---- -trigger: none -# branches: -# include: -# - feature/offlineMap - -pool: - vmImage: ubuntu-22.04 - -variables: - DB_MAP_VERSION: 12 - DB_MAP_ENDPOINT: DB_LAN - DB_MAP_CATALOG: validate.s4r2.oss.4 - PERSISTENT_STORAGE_ROOT_DIR: $(Agent.BuildDirectory)/rh_ws/hdmap - -steps: - - - checkout: self - submodules: recursive - persistCredentials: true - lfs: true - path: rh_ws - displayName: Checkout RH - - - bash: sudo apt install software-properties-common && sudo add-apt-repository universe -y - displayName: Insure that the Ubuntu Universe repository is enabled. - - - bash: sudo apt update && sudo apt install curl libcurl4-openssl-dev -y - displayName: 'Install dependencies: curl' - - - bash: sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg - displayName: Add the ROS 2 GPG key with apt - - - bash: sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu - $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list' - displayName: Add the repository to the sources list - - - bash: sudo apt update -y - displayName: Update apt sources - - - bash: sudo apt install ros-humble-ros-base python3-colcon-common-extensions ros-humble-ament* ros-humble-rmw-fastrtps-cpp -y - displayName: Install ROS2 Humble dependencies - - - bash: sudo apt install libprotobuf-dev protobuf-c-compiler protobuf-compiler -y - displayName: 'Install dependencies: libprotobuf-dev protobuf-c-compiler protobuf-compiler' - - - bash: sudo apt install libboost-all-dev -y - displayName: 'Install dependencies: libboost-all-dev' - - - bash: sudo apt install libproj-dev - displayName: 'Install dependencies: libproj-dev' - - - bash: sudo apt-get install gcovr -y - displayName: Install gcovr - - - bash: | - cd $(Agent.BuildDirectory)/rh_ws && source /opt/ros/humble/setup.bash - export RMW_IMPLEMENTATION=rmw_fastrtps_cpp - colcon build --base-paths src --cmake-args -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON --event-handlers console_cohesion+ --packages-up-to dsd_rail_horizon - colcon build --base-paths src --cmake-args -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON --event-handlers console_cohesion+ --packages-up-to dsd_mission_profile - displayName: Build Rail Horizon - - - bash: | - cd $(Agent.BuildDirectory)/rh_ws && source /opt/ros/humble/setup.bash && source ./install/local_setup.bash - export RMW_IMPLEMENTATION=rmw_fastrtps_cpp - colcon test --packages-select dsd_rail_horizon_core dsd_rail_horizon dsd_mission_profile --return-code-on-test-failure --ctest-arg -E "overTheAirUpdateIsSucessfull" - displayName: Run tests - - - task: PublishTestResults@2 - condition: succeededOrFailed() - inputs: - testResultsFormat: cTest - testResultsFiles: $(Agent.BuildDirectory)/rh_ws/build/**/Test.xml - testRunTitle: Test Results - - - bash: cd $(Agent.BuildDirectory)/rh_ws; gcovr --exclude-unreachable-branches --exclude-throw-branches -r . --filter src/ --exclude '.*tests/' --xml - -o build/coverage.xml - displayName: Generate Coverage Results - - - task: PublishCodeCoverageResults@1 - inputs: - codeCoverageTool: Cobertura - summaryFileLocation: $(Agent.BuildDirectory)/rh_ws/build/coverage.xml - displayName: Publish code coverage results diff --git a/src/dsd_map_service_ros_wrapper/package.xml b/src/dsd_map_service_ros_wrapper/package.xml index 4e0db8d..d9ee895 100644 --- a/src/dsd_map_service_ros_wrapper/package.xml +++ b/src/dsd_map_service_ros_wrapper/package.xml @@ -1,4 +1,9 @@ + + dsd_map_service_ros_wrapper diff --git a/src/dsd_rail_horizon/config/parameters.yaml b/src/dsd_rail_horizon/config/parameters.yaml index 6f52bf0..0656567 100755 --- a/src/dsd_rail_horizon/config/parameters.yaml +++ b/src/dsd_rail_horizon/config/parameters.yaml @@ -1,7 +1,7 @@ +--- # SPDX-FileCopyrightText: Copyright DB Netz AG # SPDX-License-Identifier: CC0-1.0 ---- rail_horizon_publisher: ros__parameters: rail_horizon_namespace: /rail_horizon/ diff --git a/src/dsd_rail_horizon/package.xml b/src/dsd_rail_horizon/package.xml index 51958e1..7134a58 100644 --- a/src/dsd_rail_horizon/package.xml +++ b/src/dsd_rail_horizon/package.xml @@ -1,4 +1,9 @@ + + dsd_rail_horizon diff --git a/src/dsd_rail_horizon_core/package.xml b/src/dsd_rail_horizon_core/package.xml index bd12fb8..b05725c 100644 --- a/src/dsd_rail_horizon_core/package.xml +++ b/src/dsd_rail_horizon_core/package.xml @@ -1,4 +1,9 @@ + + dsd_rail_horizon_core