Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requesting ROS 2 words for codespell ROS 2 dictionary support. #5004

Open
fujitatomoya opened this issue Feb 8, 2025 · 9 comments
Open

Requesting ROS 2 words for codespell ROS 2 dictionary support. #5004

fujitatomoya opened this issue Feb 8, 2025 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@fujitatomoya
Copy link
Collaborator

follow-up of #4997

currently codespell checker uses ony builtin dictionaries, but we could have ROS 2 dictionary to let the codespell get them for more documentation quality.

I tried some experimental things like below, and i found that ignore-words cannot work case-sensitive. that does not let the codespell detect the words from the dictionary.
see more details for codespell-project/codespell#3638.

diff --git a/Makefile b/Makefile
index e8a706bb..d783a687 100644
--- a/Makefile
+++ b/Makefile
@@ -29,7 +29,7 @@ test:
        doc8 --ignore D001 --ignore-path build
 
 spellcheck:
-       git ls-files '*.md' '*.rst' | xargs codespell --ignore-words=codespell_whitelist.txt --skip="source/Releases/*"
+       git ls-files '*.md' '*.rst' | xargs codespell -I codespell_whitelist.txt -D codespell_dictionary.txt,- --skip="source/Releases/*"
 
 linkcheck:
        $(BUILD) -b linkcheck $(OPTS) $(SOURCE) $(LINKCHECKDIR)
diff --git a/codespell_dictionary.txt b/codespell_dictionary.txt
new file mode 100644
index 00000000..1c1fb1c1
--- /dev/null
+++ b/codespell_dictionary.txt
@@ -0,0 +1 @@
+ROS2->ROS 2
diff --git a/codespell_whitelist.txt b/codespell_whitelist.txt
index b7860a05..e2a3b1ba 100644
--- a/codespell_whitelist.txt
+++ b/codespell_whitelist.txt
@@ -1 +1,2 @@
 empy
+ros2

what the above modification wants to do is to catch ROS2 and suggest ROS 2(with space) but ros2. this is because we have many words ros2 for command line examples such as ros2 topic echo xxx.
but this is not working because of codespell-project/codespell#3638.

after all, what we can do at this moment is that case-insensitive spell check and suggestion for ROS 2.
if you have any idea or suggestions, please post it here. i am all ears 👂👂👂

@fujitatomoya fujitatomoya self-assigned this Feb 8, 2025
@fujitatomoya fujitatomoya added the enhancement New feature or request label Feb 8, 2025
@fujitatomoya
Copy link
Collaborator Author

ros2bag->rosbag2

@ros-discourse
Copy link

This issue has been mentioned on ROS Discourse. There might be relevant details there:

https://discourse.ros.org/t/requesting-help-lets-make-ros-2-dictionary-for-spell-checker/42005/1

@peci1
Copy link
Contributor

peci1 commented Feb 12, 2025

tpoic->topic,srevice->service

Or are these already contained in the general spellchecker?

amnet->ament,amemt->ament,controll->control

@Tacha-S
Copy link

Tacha-S commented Feb 12, 2025

Certainly, here are some ROS-specific terms that are not typically found in standard dictionaries.
Some are commonly used throughout ROS, while others are specific to certain packages.
Depending on the scope of the dictionary you wish to create, so I’ll give an example for now.

Words that I think are commonly used throughout ROS.

actionlib
bringup
buildtool
colcon
cyclonedds
devel
distro
eval
log{info, warn, error}
pointcloud(s)
rgba
rgbd
rosdep
rosidl
rviz2
srvs
teleop
urdf
xacro

Somewhat project-specific words.

moveit
autoware
baudrate
costmap
denoise
downsampl{e, ed, ing}
amcl
navfn
raytrace
realsense
undock
velodyne
voxelgrid

@fujitatomoya
Copy link
Collaborator Author

thanks guys.

Or are these already contained in the general spellchecker?

@peci1 no i do not think so, but i can check for that.

Depending on the scope of the dictionary you wish to create, so I’ll give an example for now.

atm general one.

Words that I think are commonly used throughout ROS.

@Tacha-S those can be added to ignore word instead, i guess. unless you found misspelling examples before like ros2bag->rosbag2?

@christophebedard
Copy link
Member

ros2bag->rosbag2

What if the docs mention the ros2bag package?

@fujitatomoya
Copy link
Collaborator Author

What if the docs mention the ros2bag package?

good question, i oversighted that... thanks! i can see many of them under Release section.

@Tacha-S
Copy link

Tacha-S commented Feb 13, 2025

I thought it would be something like creating a dictionary for ROS 2, similar to this:
https://github.com/streetsidesoftware/cspell-dicts/tree/main/dictionaries

The ROS 2 example makes sense, but considering misspellings, there’s no end to the possibilities—such as swapping one character within a known word, adding an extra character, or omitting a character. I doubt it’s possible to cover everything.

Therefore, I assumed this dictionary would focus only on proper nouns related to ROS 2. However, in the example, ros2bag -> rosbag2 is listed.

In my opinion, ros2bag might have been intended to be corrected to rosbag2, but it could also refer to a command like ros2 bag play, so it’s unclear what the purpose is.

If we were to give similar examples, it might look like:

  • Moveit2 -> MoveIt 2
  • Ros -> ROS
  • Rmw -> RMW
  • Nav 2 -> Nav2

@fujitatomoya
Copy link
Collaborator Author

I thought it would be something like creating a dictionary for ROS 2, similar to this:

no it is more like https://github.com/codespell-project/codespell/tree/main/codespell_lib/data

there’s no end to the possibilities

yeah, understood. probably it would be useful what happened before, i guess.

ros2bag might have been intended to be corrected to rosbag2

as i posted above, there is an actual package for ros2cli extension, called ros2bag. so this is my bad example... sorry for the confusion.

some of your examples make sense, i will give it a shot.

as described in the issue header, actually there is an issue for the codespell, codespell-project/codespell#3638. this blocks us to detect ROS2->ROS 2 because ros2 is the correct word.

anyway, thank you very much for your idea! appreciate that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants