Skip to content

Commit

Permalink
add documentation about spell check by codespell. (#5005)
Browse files Browse the repository at this point in the history
Signed-off-by: Tomoya.Fujita <[email protected]>
(cherry picked from commit 4ec9fba)
  • Loading branch information
fujitatomoya authored and mergify[bot] committed Feb 10, 2025
1 parent 6e7fe3d commit beafdac
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 15 additions & 0 deletions codespell.cfg
Original file line number Diff line number Diff line change
@@ -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/*
3 changes: 3 additions & 0 deletions codespell_whitelist.txt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
empy
ws
lets
jupyter
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/PyCQA/doc8>`_) with the following command:

Checking / Testing the site
^^^^^^^^^^^^^^^^^^^^^^^^^^^

You can run the documentation tests locally (using `doc8 <https://github.com/PyCQA/doc8>`_) with the following command:

.. code-block:: console
make test
You can run the documentation linter locally (using `sphinx-lint <https://github.com/sphinx-contrib/sphinx-lint>`_) with the following command:

.. code-block:: console
make lint
You can run the documentation spell checker locally (using `codespell <https://github.com/codespell-project/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 <https://github.com/ros2/ros2_documentation/blob/{REPOS_FILE_BRANCH}/codespell_whitelist.txt>`_ .


View Site Through Github CI
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://hub.docker.com/_/ros/>`__.
Create a new directory with a new Dockerfile (or overwrite the existing
one) and add the following in it (or download the file
Expand Down

0 comments on commit beafdac

Please sign in to comment.