From beafdac9cf88cf7752c526df307abbd2976b1cb0 Mon Sep 17 00:00:00 2001 From: Tomoya Fujita Date: Mon, 10 Feb 2025 09:38:20 -0800 Subject: [PATCH] add documentation about spell check by codespell. (#5005) Signed-off-by: Tomoya.Fujita (cherry picked from commit 4ec9fba7c934053c065632a8d69f9ad0af096bda) --- Makefile | 2 +- codespell.cfg | 15 ++++++++++++ codespell_whitelist.txt | 3 +++ .../Contributing-To-ROS-2-Documentation.rst | 23 ++++++++++++++++++- .../Deploying-ROS-2-on-IBM-Cloud.rst | 2 +- 5 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 codespell.cfg diff --git a/Makefile b/Makefile index e8a706bba0f..b5d0ece7c46 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 --config codespell.cfg linkcheck: $(BUILD) -b linkcheck $(OPTS) $(SOURCE) $(LINKCHECKDIR) diff --git a/codespell.cfg b/codespell.cfg new file mode 100644 index 00000000000..e34631dee88 --- /dev/null +++ b/codespell.cfg @@ -0,0 +1,15 @@ +[codespell] + +# Enable built-in dictionaries/rules. +# See more details for https://github.com/codespell-project/codespell/tree/main/codespell_lib/data. +builtin = clear,rare,informal,code + +# Ignore words listed in this file. +ignore-words = codespell_whitelist.txt + +# Skip checking files in this directory. +# This folder is ignored for a couple of reasons. +# *-Changelog.rst files are generated by commit history that could include some misspellings, +# but we should keep the original commit messages here. +# Besides, it includes names of authors and contributors, which compile up the false alarms. +skip = source/Releases/* diff --git a/codespell_whitelist.txt b/codespell_whitelist.txt index b7860a05aa8..918813b83c1 100644 --- a/codespell_whitelist.txt +++ b/codespell_whitelist.txt @@ -1 +1,4 @@ empy +ws +lets +jupyter diff --git a/source/The-ROS2-Project/Contributing/Contributing-To-ROS-2-Documentation.rst b/source/The-ROS2-Project/Contributing/Contributing-To-ROS-2-Documentation.rst index feb32d8a288..5c656f264dc 100644 --- a/source/The-ROS2-Project/Contributing/Contributing-To-ROS-2-Documentation.rst +++ b/source/The-ROS2-Project/Contributing/Contributing-To-ROS-2-Documentation.rst @@ -99,12 +99,33 @@ This is the recommended way to test out local changes. The build process can take some time. To see the output, open ``build/html/index.html`` in your browser. -You can also run the documentation tests locally (using `doc8 `_) with the following command: + +Checking / Testing the site +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +You can run the documentation tests locally (using `doc8 `_) with the following command: .. code-block:: console make test +You can run the documentation linter locally (using `sphinx-lint `_) with the following command: + +.. code-block:: console + + make lint + +You can run the documentation spell checker locally (using `codespell `_) with the following command: + +.. code-block:: console + + make spellcheck + +.. note:: + + If that detects specific words that need to be ignored, add it to `codespell_whitelist `_ . + + View Site Through Github CI ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/source/Tutorials/Miscellaneous/Deploying-ROS-2-on-IBM-Cloud.rst b/source/Tutorials/Miscellaneous/Deploying-ROS-2-on-IBM-Cloud.rst index 708cf5d0661..47010283873 100644 --- a/source/Tutorials/Miscellaneous/Deploying-ROS-2-on-IBM-Cloud.rst +++ b/source/Tutorials/Miscellaneous/Deploying-ROS-2-on-IBM-Cloud.rst @@ -280,7 +280,7 @@ So now we have the full pipeline working, from creating the Dockerfile, all the way to deploying it and seeing it work on IBM Cloud. But, what if we want to use a custom set of packages we (or someone else) created? -Well that all has to do with how you set-up your Dockerfile. Lets use +Well that all has to do with how you set-up your Dockerfile. Let's use the example provided by ROS 2 `here `__. Create a new directory with a new Dockerfile (or overwrite the existing one) and add the following in it (or download the file