Enable custom uncrustify configuration with ament_lint_auto
- 主要語言
- Python
- 星號
- 50
- 分支
- 129
- 平均合併
- 3 天 10 小時
- 30 天內合併 PR
- 3
描述
# Problem
I failed to use a custom configuration for uncrustify when using it from ament_lint_auto:
* There seems to be no possibility to pass a custom configuration file directly via an argument to ament_lint_auto.
* Disabling uncrustify from ament_lint_auto by `set(ament_cmake_uncrustify_FOUND TRUE)` works as usual ,but when invoking `ament_uncrustify` explicitly (with our without a different test-name), it is actually invoked **two times**, once with the custom configuration and once with the default configuration.
I tried various modifications of the following snippet. All either ended up in uncrustify being not invoked at all or being invoked two times, as just described:
```
if(BUILD_TESTING)
find_package(ament_cmake_uncrustify REQUIRED)
ament_uncrustify(CONFIG_FILE "./code_style.cfg" TESTNAME "custom_uncrustify")
find_package(ament_lint_auto REQUIRED)
set(ament_cmake_uncrustify_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()
```
# Desired behavior
Uncrustify should be invoked only once.
* Either provide a possibility to pass the path to the custom configuration file via an environment variable
* or even auto-discover the presence of a custom configuration file in the root of the repo or package.
貢獻指南
評估
這個 Issue 還沒有評估資料。