# ITK/SimpleITK code spell checking

**URL:** https://discourse.itk.org/t/itk-simpleitk-code-spell-checking/5893
**Category:** Uncategorized
**Created:** [April 24, 2023, 3:28pm UTC](https://discourse.itk.org/t/itk-simpleitk-code-spell-checking/5893 "2023-04-24T15:28:52Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![dchen](https://discourse.itk.org/user_avatar/discourse.itk.org/dchen/32/34_2.png) [@dchen](https://discourse.itk.org/u/dchen)
#### Post date: [April 24, 2023, 3:28pm UTC](https://discourse.itk.org/t/itk-simpleitk-code-spell-checking/5893/1 "2023-04-24T15:28:52Z")

</div>

Recently, I’ve been working on spell checking the headers in ITK’s code base. My goal has been to improve the ITK/SimpleITK documentation which gets pulled from the headers. I’m posting here just to memorialize my work, in case someone needs to do likewise.

Here’s the repo for the script I use to spell check ITK’s headers and example code:

> **[GitHub - dave3d/ITK-SpellCheck: Scripts to spell check ITK's headers](https://github.com/dave3d/ITK-SpellCheck)**
>
> Scripts to spell check ITK's headers. Contribute to dave3d/ITK-SpellCheck development by creating an account on GitHub.

There’s a ‘setup’ script and the actually ‘spell’ script that does the work.

Within ‘spell’, it runs my original python script ‘codespell.py’ which comes from this repo:

> **[GitHub - SimpleITK/SimpleITKSpellChecking](https://github.com/SimpleITK/SimpleITKSpellChecking)**
>
> Contribute to SimpleITK/SimpleITKSpellChecking development by creating an account on GitHub.

For SimpleITK, we have a GitHub workflow that automatically runs spell checking on the code when a pull request is submitted. You can see that here:

> <https://github.com/SimpleITK/SimpleITK/blob/7038afae4696d44b08d0af41ea89fe645e66c34d/.github/workflows/PythonLintAndSpell.yml#L57>

You can see from the ‘–suffix’ flag that we spell check C++ headers, Python files, markdown files, and reStructuredText file.

While SimpleITK’s checking is automatic, for ITK, I’ve just been running my script by hand.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [April 24, 2023, 4:57pm UTC](https://discourse.itk.org/t/itk-simpleitk-code-spell-checking/5893/2 "2023-04-24T16:57:34Z")

</div>

Are there any blockers for adding similar checks to ITK?

---

<div class="post-metadata">

### Author: ![dchen](https://discourse.itk.org/user_avatar/discourse.itk.org/dchen/32/34_2.png) [@dchen](https://discourse.itk.org/u/dchen)
#### Post date: [April 24, 2023, 9:36pm UTC](https://discourse.itk.org/t/itk-simpleitk-code-spell-checking/5893/3 "2023-04-24T21:36:25Z")

</div>

Not that I know.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [April 25, 2023, 12:57pm UTC](https://discourse.itk.org/t/itk-simpleitk-code-spell-checking/5893/4 "2023-04-25T12:57:50Z")

</div>

I implied: it would be good if you added them for ITK too 😃

---

<div class="post-metadata">

### Author: ![dchen](https://discourse.itk.org/user_avatar/discourse.itk.org/dchen/32/34_2.png) [@dchen](https://discourse.itk.org/u/dchen)
#### Post date: [April 25, 2023, 1:01pm UTC](https://discourse.itk.org/t/itk-simpleitk-code-spell-checking/5893/5 "2023-04-25T13:01:02Z")

</div>

OK, I’ll have a look at it when I get the chance 🙂
