Add codespell integration, which checks all sources

Add a make target for running `codespell` on all sources.
Skip running codespell on the build directory (we have javascript etc.
in there).
Only emit warnings but do not fail on spelling errors in diagrams.

Signed-off-by: David Runge <dave@sleepmap.de>
This commit is contained in:
David Runge 2023-11-02 17:11:13 +01:00
parent cb4ac38e05
commit 82f59746f2
No known key found for this signature in database
GPG key ID: 90D4B9641E092971
2 changed files with 15 additions and 0 deletions

5
book/.codespellrc Normal file
View file

@ -0,0 +1,5 @@
# SPDX-FileCopyrightText: 2023 The "Notes on OpenPGP" project
# SPDX-License-Identifier: CC0-1.0
[codespell]
skip = ./build,./source/diag/*.svg

View file

@ -6,9 +6,11 @@
# You can set these variables from the command line, and also
# from the environment for the first two.
CODESPELL ?= codespell
SPHINXOPTS ?= -W
SPHINXBUILD ?= sphinx-build
LYCHEE ?= lychee
PRINTF ?= printf
SOURCEDIR = source
BUILDDIR = build
@ -19,6 +21,14 @@ help:
html-linkcheck: clean html
@$(LYCHEE) "$(BUILDDIR)/html/"*.html
# spell check all sources
# NOTE: diagrams are not yet spell checked, but we emit the required changes
codespell:
@$(PRINTF) "The following change suggestions are only warnings!\n"
@$(CODESPELL) source/diag || true
@$(PRINTF) "The following change suggestions are errors!\n"
@$(CODESPELL) .
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new