tools/nxstyle: Whitelist lifecycle_msgs GetState/State identifiers.#19050
tools/nxstyle: Whitelist lifecycle_msgs GetState/State identifiers.#19050arjav1528 wants to merge 1 commit into
Conversation
|
Some of these are really generic identifiers (State, GetState, etc.). Maybe we should find a more permanent solution than just blanket whitelisting them? Can we restrict them to specific library? Maybe certain directories in I just think that the more we add here, the less will be caught later in different apps where these shouldn't be whitelisted. Thoughts? |
Good point. "State" and "GetState" are way too generic on their own. They're also redundant: the lifecycle_msgs prefix already matches the full mangled identifiers (lifecycle_msgs__srv__GetState_Request, lifecycle_msgs__msg__State, etc.), so dropping the bare ones doesn't lose coverage for this case. I'll amend to keep only lifecycle_msgs and rosidl_runtime_c — both are package-prefixed and unlikely to collide. EDIT : ammended |
Phase 8 of the micro-ROS on NuttX integration adds GetState service
server and client examples under apps/examples/microros_{srv,cli}.
The rosidl token-pasting macros generate identifiers such as
lifecycle_msgs__srv__GetState_Request
lifecycle_msgs__srv__GetState_Response
lifecycle_msgs__msg__State__PRIMARY_STATE_ACTIVE
rosidl_runtime_c__String__assign
Add the lifecycle_msgs package name and the rosidl_runtime_c prefix
to the existing rosidl whitelist introduced for Int32 / std_msgs
identifiers. Both prefixes are package-scoped and already cover the
full mangled identifiers above, so no bare CamelCase tokens are added.
Signed-off-by: Arjav Patel <arjav1528@gmail.com>
b800403 to
d9f4043
Compare
Idk if that was an LLM answer but that's not my main concern. My concern is that the ignored symbols should have some way to be restricted to a single directory (like your micro-ros library in |
makes sense, I kinda agree that global whitelist has this problem already, std_msgs, int32, etc. are all same shape, further will collide with anything else which are using those names. The current PR follows that existing precedent for microROS bits that I need. what should I do, like should I land this as is, and open a new PR adding nxstyle.txt lookup from the source file (btw: I agree that the comment you mentioned was almost an LLM ans.. "almost") |
|
Maybe this discussion should be had with the mailing list since it concerns one of the "inviolables", but my preferred solution would be:
As bonus, we should move all the globally ignored symbols to However, we should see what other people think. Maybe I'm just crazy :) |
Summary
Phase 8 of the micro-ROS on NuttX integration adds GetState service serverand client examples under
apps/examples/microros_{srv,cli}(paired apps PR). Therosidltoken-pasting macros generate identifiers such as:CamelCase tokens (
GetState,State,String) cannot be renamed without breaking the public ROS C client API. Adds them, thelifecycle_msgspackage prefix, and therosidl_runtime_cruntime prefix to the existingg_white_prefixwhitelist seeded for Int32/std_msgs identifiers in earlier phases.Paired apps PR:
examples/microros_{srv,cli}: Add minimal lifecycle GetState service example.(apache/nuttx-apps). This nuttx PR must merge first — otherwise the apps PR fails nxstyle CI on the new examples.Impact
affected.
Testing
Host: Ubuntu 22.04 jammy on AWS EC2 m7i-flex.large, gcc-12.
Built the apps examples (
microros_srv,microros_cli) on top ofsim:nshagainst this whitelist — both compile clean and passtools/checkpatch.shafter this change. Without this change,tools/nxstyleflags identifier-naming violations on every rosidl-generatedlifecycle_msgs__*symbol the new examples reference.Runtime behavior of the examples themselves is covered in the paired apps PR Testing section (GetState round-trip with
ros2 service callagainst a dockermicro-ros-agent:jazzy).