diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f1d478c3f61..c287342bbfc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,6 +37,23 @@ jobs: - name: Lint run: make lint + spellcheck: + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Install dependencies with pip + run: pip install --no-warn-script-location --user -r requirements.txt -c constraints.txt + + - name: Spellcheck + run: make spellcheck + build: needs: [test, lint] runs-on: ubuntu-22.04 diff --git a/Makefile b/Makefile index 5014099150f..e8a706bba0f 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,9 @@ lint: test: doc8 --ignore D001 --ignore-path build +spellcheck: + git ls-files '*.md' '*.rst' | xargs codespell --ignore-words=codespell_whitelist.txt --skip="source/Releases/*" + linkcheck: $(BUILD) -b linkcheck $(OPTS) $(SOURCE) $(LINKCHECKDIR) @echo diff --git a/README.md b/README.md index 062f63b4759..3de74eb10be 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,15 @@ For local testing of the current tree use: `sensible-browser build/html/index.html` +### Spelling Check + +To check the spelling, use: + +`make spellcheck` + +> [!NOTE] +> If that detects specific words that need to be ignored, add it to [codespell_whitelist](./codespell_whitelist.txt). + ### Deployment test To test building the multisite version deployed to the website use: diff --git a/codespell_whitelist.txt b/codespell_whitelist.txt new file mode 100644 index 00000000000..b7860a05aa8 --- /dev/null +++ b/codespell_whitelist.txt @@ -0,0 +1 @@ +empy diff --git a/requirements.txt b/requirements.txt index 2406de14841..d75e4c9adbf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +codespell doc8 docutils pip diff --git a/source/The-ROS2-Project/Contributing/Code-Style-Language-Versions.rst b/source/The-ROS2-Project/Contributing/Code-Style-Language-Versions.rst index c1284cb634d..5ee4cfafe68 100644 --- a/source/The-ROS2-Project/Contributing/Code-Style-Language-Versions.rst +++ b/source/The-ROS2-Project/Contributing/Code-Style-Language-Versions.rst @@ -166,9 +166,9 @@ Pointer Syntax Alignment Class Privacy Keywords ~~~~~~~~~~~~~~~~~~~~~~ -* Do not put 1 space before ``public:``, ``private:``, or ``protected:``, it is more consistent for all indentions to be a multiple of 2 +* Do not put 1 space before ``public:``, ``private:``, or ``protected:``, it is more consistent for all indentations to be a multiple of 2 - * rationale: most editors don't like indentions which are not a multiple of the (soft) tab size + * rationale: most editors don't like indentations which are not a multiple of the (soft) tab size * Use zero spaces before ``public:``, ``private:``, or ``protected:``, or 2 spaces * If you use 2 spaces before, indent other class statements by 2 additional spaces * Prefer zero spaces, i.e. ``public:``, ``private:``, or ``protected:`` in the same column as the class @@ -254,7 +254,7 @@ This is **not** OK: } -Use open braces rather than excessive indention, e.g. for distinguishing constructor code from constructor initializer lists +Use open braces rather than excessive indentation, e.g. for distinguishing constructor code from constructor initializer lists This is OK: @@ -364,7 +364,7 @@ Since there is not an existing CMake style guide we will define our own: * Use ``snake_case`` identifiers (variables, functions, macros). * Use empty ``else()`` and ``end...()`` commands. * No whitespace before ``(``\ 's. -* Use two spaces of indention, do not use tabs. +* Use two spaces of indentation, do not use tabs. * Do not use aligned indentation for parameters of multi-line macro invocations. Use two spaces only. * Prefer functions with ``set(PARENT_SCOPE)`` to macros. * When using macros prefix local variables with ``_`` or a reasonable prefix.