Skip to content

Conversation

@Excelsius314
Copy link

@Excelsius314 Excelsius314 commented Aug 22, 2025

Main use is for setting cmake varaibles i.e. colcon build --ament-cmake-args -DVAR=VALUE

This is currently used for python-cmake packages to rebuild the venv manually by setting: -DSKIP_VENV=OFF

Syntax for hector build would be:

hector build --ament-cmake-args SKIP_VENV=OFF ISOLATED=ON ...

Also includes a small ci update, due to a formatting error from the old version.

@Excelsius314 Excelsius314 self-assigned this Aug 22, 2025
Comment on lines +30 to +33
- name: Install and Run pre-commit
uses: pre-commit/[email protected]
with:
extra_args: --all-files
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you running the pre-commit hooks in the CI?
That would mask any formatting issues that were committed.

Comment on lines +33 to +48
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v20.1.4
hooks:
- id: clang-format
name: Clang Format
args: [--style=file]
files: \.(cpp|hpp|h|c|cc)$

- repo: local
hooks:
- id: cppcheck
name: Cppcheck
entry: bash -c "cppcheck --force --quiet --inline-suppr --error-exitcode=1 --language=c++ $(find . -type d -name 'cmake-build-*' -prune -false -o -name '*.cpp' -o -name '*.hpp' -o -name '*.h' -o -name '*.c' -o -name '*.cc')"
language: system
files: \.(cpp|cc|hpp|h)$
pass_filenames: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no and probably never will be any CPP in this repo.

build_base: str = "build",
install_base: str = "install",
cmake_clean_cache: bool = False,
ament_cmake_args: list[str] = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, your default value is violating the type annotation.
This is also wrong for the mixin arg, though.

)
if ament_cmake_args:
arguments += ["--ament-cmake-args"] + list(
map(lambda x: f"{"-D" + x}", ament_cmake_args)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There may be other arguments than -DVAR=VALUE, or is that the only argument allowed to be passed to ament cmake?
And it's a bit weird to use a format string and then just concatenate the string in an expression.
Should be f"-D{x}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants