Spell check in OpenBMC CI

manoj kiran manojkiran.eda at gmail.com
Tue Mar 23 00:44:01 AEDT 2021


Apologies for sending this email again - for some reason it fails to
publish this on to mailing list.

Hi All,

OpenBMC coders are all atrocious spellers. In my opinion, spell-checks are
never given the highest priority as we always were more obsessed with code.
Correcting spelling mistakes is not as easy as it sounds, it cannot be
automated as many reasonable-sounding corrections could change the meaning
of the comment.

I have been recently working on enabling the spell check on commits in
OpenBMC CI so that the CI can score a -1 when it sees a potential
incorrect/misspelled word(s) in the commit as per its knowledge acquired
from the dictionary.
While checking the existing implementations in various opensource projects,
I was impressed with the way the Linux project[1] addressed this issue, It
seems to use a python library called codespell [2] for improving their
upstream patches. It seemed pretty simple & doable even in OpenBMC.

As an initial work, tried to bring the same package in OpenBMC & my intent
is to start with just checking the commit message first [3], and then
improve the infrastructure to check the comments in the code as well. The
only real concern is that we should have a dictionary that should be simple
& easily editable.

My initial patch-set addresses this issue by having two dictionaries:
One generic dictionary that comes along with the code spell library [4], so
that we can update this dictionary with the mistakes done at a global level.

Another OpenBMC specific dictionary[5] that sits in the
openbmc-build-scripts repository, allows users of OpenBMC to add words into
them. ( I copied the dictionary currently being used in the Linux project
as an initial version)

Dictionary format :
Each line corresponds to a single word and they follow the "mistake->
correction" format.

I'd love community feedback on this . Please feel free to stop by [3] and
give your suggestions/review comments.

Thanks,
Manoj

[1] https://github.com/torvalds/linux/blob/master/scripts/checkpatch.pl#L62
[2] https://github.com/codespell-project/codespell
[3]
https://gerrit.openbmc-project.xyz/c/openbmc/openbmc-build-scripts/+/41454
[4]
https://github.com/codespell-project/codespell/blob/master/codespell_lib/data/dictionary.txt
[5]
https://gerrit.openbmc-project.xyz/c/openbmc/openbmc-build-scripts/+/41454/1/dictionary/openbmc-spelling.txt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20210322/a6b439ed/attachment.htm>


More information about the openbmc mailing list