]> Savannah Git Hosting - gnulib.git/commitdiff
maintainer-makefile: Check spelling using 'codespell'.
authorSimon Josefsson <simon@josefsson.org>
Thu, 27 Mar 2025 18:45:30 +0000 (19:45 +0100)
committerSimon Josefsson <simon@josefsson.org>
Thu, 27 Mar 2025 18:45:30 +0000 (19:45 +0100)
* top/maint.mk (sc_codespell): Add.

ChangeLog
top/maint.mk

index d60af23955611c111438f3c25a33e4abbbf04429..a6b62b9f4434d94e7ac66feecf9f7a22efeba27b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2025-03-27  Simon Josefsson  <simon@josefsson.org>
+
+       maintainer-makefile: Check spelling using 'codespell'.
+       * top/maint.mk (sc_codespell): Add.
+
 2025-03-24  Paul Eggert  <eggert@cs.ucla.edu>
 
        same-inode: don't assume memory objects have ino
index 8c9fff55aba4306ae215de71769463b1cd1ef5d6..4ac59914c81df77f2f4ad1d09456befbe754da38 100644 (file)
@@ -1815,6 +1815,21 @@ sc_indent:
              exit 1; } || :;                                           \
        fi
 
+# Check code spelling.
+# Example 'cfg.mk' settings for inspiration:
+# codespell_ignore_words_list = foo
+# exclude_file_name_regexp--sc_codespell = ^po/.*.po|doc/.*.pdf$$
+# codespell_extra_args = --summary --count
+# codespell_args = --ignore-words=doc/my-codespell-ignores.txt
+codespell_args ?= --ignore-words-list $(codespell_ignore_words_list) \
+       $(codespell_extra_args)
+sc_codespell:
+       @if ! command -v codespell > /dev/null; then                    \
+          echo 1>&2 '$(ME): sc_codespell: codespell is missing';       \
+       else                                                            \
+          codespell $(codespell_args) $$($(VC_LIST_EXCEPT));           \
+       fi
+
 # If you want to set UPDATE_COPYRIGHT_* environment variables,
 # put the assignments in this variable.
 update-copyright-env ?=