ament / ament/ament_lint

Enable custom uncrustify configuration with ament_lint_auto

未關閉
#308 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
enhancement help wanted
主要語言
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 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。