Skip to content

Commit

Permalink
automatic spellcheck by codespell for common misspellings. (#4997) (#…
Browse files Browse the repository at this point in the history
…5000)

* automatic spellcheck by codespell for common misspellings.

Signed-off-by: Tomoya Fujita <[email protected]>

* remove indention from the whitelist.

Signed-off-by: Tomoya Fujita <[email protected]>

---------

Signed-off-by: Tomoya Fujita <[email protected]>
(cherry picked from commit b9fb2b4)

Co-authored-by: Tomoya Fujita <[email protected]>
  • Loading branch information
mergify[bot] and fujitatomoya authored Feb 6, 2025
1 parent 4a31ae2 commit 30c00ef
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 4 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions codespell_whitelist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
empy
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
codespell
doc8
docutils
pip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 30c00ef

Please sign in to comment.