From: Tom de Vries Date: Thu, 6 Mar 2025 16:38:32 +0000 (+0100) Subject: [gdbsupport] Add codespell section in setup.cfg X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=61cc67a504e9b2a9ade6d33b0e74c346c41f94bd;p=thirdparty%2Fbinutils-gdb.git [gdbsupport] Add codespell section in setup.cfg When running codespell on gdbsupport, we get: ... $ codespell gdbsupport gdbsupport/common-debug.h:218: invokable ==> invocable gdbsupport/osabi.h:51: configury ==> configurable gdbsupport/ChangeLog-2020-2021:344: ro ==> to, row, rob, rod, roe, rot gdbsupport/ChangeLog-2020-2021:356: contaning ==> containing gdbsupport/common.m4:19: configury ==> configurable gdbsupport/Makefile.am:97: configury ==> configurable gdbsupport/Makefile.in:811: configury ==> configurable gdbsupport/event-loop.cc:84: useable ==> usable gdbsupport/configure:15904: assigment ==> assignment ... Some of these files we want to skip in a spell check, because they're generated. We also want to skip ChangeLogs, we don't actively maintain those. Add a file gdbsupport/setup.cfg with a codespell section, that skips those files. The choice for setup.cfg (rather than say .codespellrc) comes from the presence of gdb/setup.cfg. That leaves invokable, configury and useable. I think configury is a common expression in our context, and for invokable and useable I don't manage to find out whether they really need rewriting, so I'd rather leave them alone for now. Add these to a file gdb/contrib/codespell-ignore-words.txt, and use the file in gdbsupport/setup.cfg. This makes the directory codespell clean: ... $ codespell --config gdbsupport/setup.cfg gdbsupport $ ... Because codespell seems to interpret filenames relative to the working directory rather than relative to the config file, and the filename used in gdbsupport/setup.cfg is gdb/contrib/codespell-ignore-words.txt, this simple invocation doesn't work: ... $ cd gdbsupport $ codespell ... because codespell can't find gdbsupport/gdb/contrib/codespell-ignore-words.txt. We could fix this by using ../gdb/contrib/codespell-ignore-words.txt instead, but likewise that breaks this invocation: ... $ codespell --config gdbsupport/setup.cfg gdbsupport ... I can't decide which one is worse, so I'm sticking with gdb/contrib/codespell-ignore-words.txt for now. Approved-By: Simon Marchi --- diff --git a/gdb/contrib/codespell-ignore-words.txt b/gdb/contrib/codespell-ignore-words.txt new file mode 100644 index 00000000000..a8287f71286 --- /dev/null +++ b/gdb/contrib/codespell-ignore-words.txt @@ -0,0 +1,3 @@ +configury +invokable +useable diff --git a/gdbsupport/setup.cfg b/gdbsupport/setup.cfg new file mode 100644 index 00000000000..e3e92988fd7 --- /dev/null +++ b/gdbsupport/setup.cfg @@ -0,0 +1,4 @@ +[codespell] +# Skip ChangeLogs and generated files. +skip = ChangeLog*,Makefile.in,configure +ignore-words = gdb/contrib/codespell-ignore-words.txt