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

automatic spellcheck by codespell for common misspellings. (backport #4997) #5000

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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