]> git.ipfire.org Git - thirdparty/linux.git/commit
checkpatch: use utf-8 match for spell checking
authorAntonio Borneo <antonio.borneo@foss.st.com>
Mon, 16 Jun 2025 07:59:13 +0000 (09:59 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 10 Jul 2025 05:57:53 +0000 (22:57 -0700)
commit5eee4c2b2aebfd3c8f11d9722e49d838da4e4150
treef3bcf4eef3d7d3181008d8baee594b61e11ba05c
parente795000e755c309d1f9bd2a0590eca38b4625f3a
checkpatch: use utf-8 match for spell checking

The current code that checks for misspelling verifies, in a more
complex regex, if $rawline matches [^\w]($misspellings)[^\w]

Being $rawline a byte-string, a utf-8 character in $rawline can
match the non-word-char [^\w].
E.g.:
./scripts/checkpatch.pl --git 81c2f059ab9
WARNING: 'ment' may be misspelled - perhaps 'meant'?
#36: FILE: MAINTAINERS:14360:
+M:     Clément Léger <clement.leger@bootlin.com>
            ^^^^

Use a utf-8 version of $rawline for spell checking.

Link: https://lkml.kernel.org/r/20250616-b4-checkpatch-upstream-v2-1-5600ce4a3b43@foss.st.com
Signed-off-by: Antonio Borneo <antonio.borneo@foss.st.com>
Signed-off-by: Clément Le Goffic <clement.legoffic@foss.st.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
Cc: Joe Perches <joe@perches.com>
Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
scripts/checkpatch.pl