Skip to content

Add polymath-ros linter which adds a check for executor threads#10

Merged
skyegalaxy merged 8 commits into
mainfrom
skyegalaxy/add-ros-linter
Jun 16, 2026
Merged

Add polymath-ros linter which adds a check for executor threads#10
skyegalaxy merged 8 commits into
mainfrom
skyegalaxy/add-ros-linter

Conversation

@skyegalaxy

@skyegalaxy skyegalaxy commented Jun 12, 2026

Copy link
Copy Markdown
Member

Adds a new check, polymath-ros under which opinionated ROS linting can be added. The first one in this category checks that all instances of Multi-Threaded (or Callback Group) executors specify thread_num in their constructor.
The rules allow for passing 0 explicitly (which defaults to std::hardware_concurrency), because we want it to be an explicit choice on the part of the user instead of a consequence of default construction.

image

@skyegalaxy skyegalaxy marked this pull request as ready for review June 12, 2026 22:04
@skyegalaxy skyegalaxy requested a review from emersonknapp June 12, 2026 22:19
Skyler Medeiros added 7 commits June 16, 2026 11:18
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
@skyegalaxy skyegalaxy force-pushed the skyegalaxy/add-ros-linter branch from a8ee69e to 9b34e81 Compare June 16, 2026 18:22

@emersonknapp emersonknapp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A little concerned about the ability of this check to generalize to different code formatting, but that doesn't have to block us from getting it in, since it's an opt-in check. We can iterate forward.

One comment on package structure that I'd prefer before merging

Comment thread polymath_code_standard/checkers/ros/executor_lint.py
Comment thread polymath_code_standard/checkers/ros.py Outdated
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
@skyegalaxy skyegalaxy merged commit ea9eeab into main Jun 16, 2026
3 checks passed
@skyegalaxy skyegalaxy deleted the skyegalaxy/add-ros-linter branch June 16, 2026 20:25
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.

2 participants