qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH] Add new build target 'check-spelling'


From: Stefan Weil
Subject: Re: [RFC PATCH] Add new build target 'check-spelling'
Date: Mon, 31 Oct 2022 17:45:08 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.0

Below I added some examples for the words which are currently ignored by codespell.

Am 31.10.22 um 16:40 schrieb Philippe Mathieu-Daudé:

On 31/10/22 08:43, Stefan Weil via wrote:
`make check-spelling` can now be used to get a list of spelling errors.
It uses the latest version of codespell, a spell checker implemented in Python.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---

This RFC can already be used for manual tests, but still reports false
positives, mostly because some variable names are interpreted as words.
These words can either be ignored in the check, or in some cases the code
might be changed to use different variable names.

The check currently only skips a few directories and files, so for example
checked out submodules are also checked.

The rule can be extended to allow user provided ignore and skip lists,
for example by introducing Makefile variables CODESPELL_SKIP=userfile
or CODESPELL_IGNORE=userfile. A limited check could be implemented by
providing a base directory CODESPELL_START=basedirectory, for example
CODESPELL_START=docs.

Regards,
Stefan

  tests/Makefile.include       | 10 ++++++++++
  tests/codespell/README.rst   | 18 ++++++++++++++++++
  tests/codespell/exclude-file |  3 +++
  tests/codespell/ignore-words | 19 +++++++++++++++++++
  tests/requirements.txt       |  1 +
  5 files changed, 51 insertions(+)
  create mode 100644 tests/codespell/README.rst
  create mode 100644 tests/codespell/exclude-file
  create mode 100644 tests/codespell/ignore-words

Just wondering about this list...

+++ b/tests/codespell/ignore-words
@@ -0,0 +1,19 @@
+buid

What is 'buid'? PPC-specific apparently.

hw/ppc/spapr_pci.c:SpaprPhbState *spapr_pci_find_phb(SpaprMachineState *spapr, uint64_t buid) include/hw/ppc/xics.h: * We currently only support one BUID which is our interrupt base
[...]


+busses
+dout
+falt
+fpr
+hace
+hax
+hda
+nd

Apparently 'NIC info'...
hw/arm/aspeed.c:    NICInfo *nd = &nd_table[0];
hw/display/macfb.c:    NubusDevice *nd = NUBUS_DEVICE(s);
[...]


+ot

Is 'ot' MemOp?

target/i386/tcg/decode-new.c.inc:static bool decode_op_size(DisasContext *s, X86OpEntry *e, X86OpSize size, MemOp *ot)
[...]


+pard
+parm
+ptd
+ser
+som
+synopsys
+te

Is that 'target endianness'?

accel/tcg/cputlb.c: * @te: pointer to CPUTLBEntry
hw/audio/cs4231a.c:#define TE (1 << 6)
[...]


+toke

Where is 'toke'?

This one is no longer needed. It was used in the old capstone code which I still had in my local sources.


+ue
Where is 'ue'?
tests/tcg/i386/test-i386-fp-exceptions.c:#define UE (1 << 4)
tests/unit/test-keyval.c:    qdict = keyval_parse("val,,ue", "implied", NULL, &err);
[...]

I simply had added some examples of "words" which occurred often and which were reported by codespell as typos. These "typos" occur at least 10 times (list produced with `grep "^[a-z]" codespell.log | sort -n +1`):

statics      10
regiser      11
usig         11
inh          12
tne          12
overriden    13
inactivate   15
upto         15
hsa          16
useable      17
daa          18
crate        21
endianess    22
olt          22
sring        23
vill         25
keypairs     35
gir          46
sav          47
asign       120
inflight    191

Some of them are real typos, others like aSign or statics are variable names and should be ignored, too.

Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]