codespell mysteries explained

Douglas Bagnall douglas.bagnall at catalyst.net.nz
Tue Aug 22 00:58:08 UTC 2023


I was trying to run

  codespell $(git diff origin/master --name-only)

to catch my typos before CI does, but they seem to find completely 
disjoint sets of complaints. That is, *none* of the local codespell 
issues were raised by CI, and vice versa.

Locally I have "codespell 2.1.0" on Ubuntu 22.04. It doesn't care when I 
write "secuirty" in a C comment, while CI does. And it does say a lot of

  python/samba/tests/sddl.py:193: BA ==> BY, BE

which CI doesn't mention.

Adding "ba" to .codespellignore makes the "BA" complaints disappear. I 
would prefer to just ignore uppercase "BA", but when the manpage says

   Words are case sensitive based on how they are written in
   the dictionary file

it is saying you *can't* ignore uppercase only if the codespell 
dictionary[1] doesn't contain a "BA->..." line. It doesn't.

[1]/usr/lib/python3/dist-packages/codespell_lib/data/dictionary.txt

The local dictionary also doesn't contain "secuirty". The upstream 
version does, and it doesn't have the "ba". So that explains everything.

When I started this email, it was going to be along the lines of "WTF am 
I missing", but it turns out to be quite simple. If you have an ancient 
OS (from, say, last year) don't expect to be able to replicate codespell 
CI locally.

Douglas



More information about the samba-technical mailing list