Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pre-commit configuration (backport #28) #29

Merged
merged 2 commits into from
Aug 15, 2024
Merged
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
2 changes: 1 addition & 1 deletion .devcontainer/nouveau/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"esbenp.prettier-vscode",
"xaver.clang-format",
"charliermarsh.ruff",
"jeff-hykin.better-cpp-syntax"
"ms-vscode.cmake-tools"
]
}
}
Expand Down
3 changes: 1 addition & 2 deletions .devcontainer/nvidia/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
"esbenp.prettier-vscode",
"xaver.clang-format",
"charliermarsh.ruff",
"ms-python.black-formatter",
"jeff-hykin.better-cpp-syntax"
"ms-vscode.cmake-tools"
]
}
}
Expand Down
9 changes: 5 additions & 4 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG ROS_DISTRO=jazzy
FROM ros:$ROS_DISTRO-ros-base as ci

Check warning on line 2 in .docker/Dockerfile

View workflow job for this annotation

GitHub Actions / robot (jazzy)

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /root/ws_ros
Expand Down Expand Up @@ -35,7 +35,7 @@
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

FROM ci as robot

Check warning on line 38 in .docker/Dockerfile

View workflow job for this annotation

GitHub Actions / robot (jazzy)

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

ENV DEBIAN_FRONTEND=noninteractive

Expand All @@ -62,7 +62,8 @@
ENV VIRTUAL_ENV=$USER_WORKSPACE/.venv/$PROJECT_NAME
RUN python3 -m venv --system-site-packages $VIRTUAL_ENV \
&& echo "source ${VIRTUAL_ENV}/bin/activate" >> /home/$USERNAME/.bashrc \
&& touch .venv/COLCON_IGNORE
&& touch .venv/COLCON_IGNORE \
&& echo "\n# Ensure colcon is run in the venv\nalias colcon='python3 -m colcon'" >> /home/$USERNAME/.bashrc
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

# Uncomment to download and install external repos used by the project
Expand All @@ -83,7 +84,7 @@
&& echo "source ${USER_WORKSPACE}/install/setup.bash" >> /home/$USERNAME/.bashrc \
&& echo "if [ -f /opt/ros/${ROS_DISTRO}/setup.bash ]; then source /opt/ros/${ROS_DISTRO}/setup.bash; fi" >> /home/$USERNAME/.bashrc

FROM robot as desktop

Check warning on line 87 in .docker/Dockerfile

View workflow job for this annotation

GitHub Actions / robot (jazzy)

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

ENV DEBIAN_FRONTEND=noninteractive
ENV USER_WORKSPACE=/home/$USERNAME/ws_ros
Expand All @@ -98,7 +99,7 @@
&& sudo apt-get clean -y \
&& sudo rm -rf /var/lib/apt/lists/*

FROM desktop as desktop-nvidia

Check warning on line 102 in .docker/Dockerfile

View workflow job for this annotation

GitHub Actions / robot (jazzy)

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

# Install NVIDIA software
RUN sudo apt-get update \
Expand All @@ -115,6 +116,6 @@
&& sudo rm -rf /var/lib/apt/lists/*

# Env vars for the nvidia-container-runtime.
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute
ENV QT_X11_NO_MITSHM 1
ENV NVIDIA_VISIBLE_DEVICES=all
ENV NVIDIA_DRIVER_CAPABILITIES=graphics,utility,compute
ENV QT_X11_NO_MITSHM=1
17 changes: 9 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ repos:
hooks:
- id: codespell

- repo: local
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.8
hooks:
- id: clang-format
name: clang-format
description: Format files with ClangFormat.
entry: clang-format-18
language: system
files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|proto|vert)$
args: ['-fallback-style=Google', '-i']
- id: clang-format
types_or: [c++, c]

- repo: https://github.com/BlankSpruce/gersemi
rev: 0.13.5
hooks:
- id: gersemi

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
Expand Down
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
"C_Cpp.codeAnalysis.clangTidy.enabled": true,
"C_Cpp.codeAnalysis.clangTidy.codeAction.formatFixes": true,
"clang-format.executable": "/usr/bin/clang-format-18",
"xml.format.maxLineWidth": 120,
"xml.format.splitAttributes": "alignWithFirstAttr",
"[cpp]": {
"editor.rulers": [120],
"editor.tabSize": 2,
Expand Down Expand Up @@ -73,5 +75,6 @@
"**/build": true,
"**/install": true,
"**/log": true
}
},
"cmake.ignoreCMakeListsMissing": true
}
6 changes: 2 additions & 4 deletions example_pkg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
cmake_minimum_required(VERSION 3.8)
project(example_pkg)

set(THIS_PACKAGE_INCLUDE_DEPENDS
ament_cmake
)
set(THIS_PACKAGE_INCLUDE_DEPENDS ament_cmake)

foreach(Dependency IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS})
find_package(${Dependency} REQUIRED)
find_package(${Dependency} REQUIRED)
endforeach()

ament_package()