rosidl_generator_py: linters are exec_depends although generated-code lint tests are opt-in
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 1-2 天
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- cmake, python
- 领域
- build-system
调研方向
Start by comparing the linter dependency declarations in rosidl_generator_py/package.xml with the opt-in linter block in rosidl_generator_c, then read rosidl_generator_py_generate_interfaces.cmake and the ADD_LINTER_TESTS documentation. The proposal is to move the five linters to test dependencies and add an actionable configure error naming the required dependency. Done means opt-in users get that guidance and ordinary installs no longer pull in the linters.
由索引模型根据 Issue 内容生成。
描述
rosidl_generator_py/package.xml has five linter packages as <exec_depend>: ament_cmake_cpplint, ament_cmake_flake8, ament_cmake_mypy, ament_cmake_pep257 and ament_cmake_uncrustify on rolling (ament_cmake_cppcheck in place of ament_cmake_mypy on jazzy). They were added in #199 to fix #198. A package that passed ADD_LINTER_TESTS to rosidl_generate_interfaces() failed to configure because it did not depend on ament_cmake_flake8 itself. The comment in package.xml already notes they are only needed by downstream tests.
rosidl_core_runtime has rosidl_generator_py as a build_export_depend, so every binary install that contains a message package also installs the five linters and what they pull in. A deployment that never builds message packages never uses them. (We currently repack rosidl_generator_py without them for our production environment.)
rosidl_generator_c has the same opt-in block (if(BUILD_TESTING AND rosidl_generate_interfaces_ADD_LINTER_TESTS) followed by find_package(ament_cmake_cpplint REQUIRED)), but no linter exec_depend. A package that opts in there declares the linters as its own test dependencies.
Proposal
Handle rosidl_generator_py the way rosidl_generator_c does:
- Move the five linters from
<exec_depend>to<test_depend>. - In
rosidl_generator_py_generate_interfaces.cmake, keepfind_package(... REQUIRED)but add a clear configure error naming the<test_depend>to add, so the #198 case fails with an actionable message. - Mention in the
ADD_LINTER_TESTSdocumentation that the calling package musttest_dependon the linters (orament_lint_common).
ADD_LINTER_TESTS is off by default, so only packages that opt in are affected. If maintainers prefer to keep the dependencies until a test_export_depend exists, an alternative is find_package(... QUIET) with a warning that skips the generated-code lint tests when a linter is missing.
I can open a PR if this direction is acceptable.
- 主要语言
- EmberScript
- 星标
- 26
- 派生
- 75
- 平均合并
- 6 天 7 小时
- 30 天内合并 PR
- 5
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ros2/rosidl_python 的其他 Issue
-
Eliminate array resetting loop in _msg_support.c.em可能已有人在做 @Lidang-Jiang 于 216 天前认领。 未关闭enhancement
难度 2/5 1-3 小时 新手友好度 72/100
ros2/rosidl_python#255 · 1 个 reaction ·
-
Generated message fails when a fixed-size array message has a field named range (shadowing built-in)可能已有人在做 @Rahul-cs50 于 20 天前认领。 未关闭bug
难度 3/5 1-2 天 新手友好度 54/100
ros2/rosidl_python#275 ·
-
bug
难度 3/5 1-2 天 新手友好度 56/100
ros2/rosidl_python#264 · 2 条评论 ·
-
Message named pkg/Duration with field builtin_interfaces/Duration is invalid可能已有人在做 @Lidang-Jiang 于 215 天前认领。 未关闭bug
难度 4/5 3-5 天 新手友好度 55/100
ros2/rosidl_python#257 · 8 条评论 ·
-
enhancement
难度 3/5 1-2 天 新手友好度 35/100
ros2/rosidl_python#242 ·
查看 ros2/rosidl_python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 92/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
metanorma/metanorma#768 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
ehmpathy/declapract-typescript-ehmpathy#891 ·
维护者通常 2 天内回复
-
backlog
难度 2/5 1-3 小时 新手友好度 78/100
sagemathinc/sagebrush#2768 ·
维护者通常 1 天内回复