Skip to content

Conversation

@Josverl
Copy link
Contributor

@Josverl Josverl commented Nov 18, 2025

Add the codespell configuration based on the micropython/micropython repo.
this was triggered by recent fixes and a comment from Damien

  • Configuration added:
    • pyproject.toml
      Codespell configuration with:
      • ignore-words stored in tools/ignore_words.txt
      • enablement of codespell ignore blocks
    • codespell.yml
      GitHub action runs on Push and PR
    • .pre-commit-config.yaml
      runs codespell on commit.
  • The 2nd commit contains spelling corrections in comments , docstrings , and .md files based on the above configuration
  • 3rd commit is the only code change. The requests module has a typo in the name a a variable (formated --> formatted)
    While this is a minor code change I did bump the version for that module.

Example:

# This will be checked

# codespell:ignore-begin

# this part wil not be cheked

# codespell:ignore-end

Testing

Tested locally and in CI

Labeled as Docs- as there is no 🔨tools label

@Josverl Josverl requested a review from dpgeorge November 18, 2025 17:27
@Josverl Josverl added the docs label Nov 18, 2025
@Josverl Josverl force-pushed the chore_codespell branch 2 times, most recently from d108cc8 to 09160fd Compare November 18, 2025 17:39
pyproject.toml Outdated
[tool.codespell]
count = ""
ignore-regex = '\b[A-Z]{3}\b'
ignore-words-list = "ans,asend,deques,dout,emac,extint,hsi,iput,mis,notin,numer,ser,shft,synopsys,technic,ure,curren,te,bu,curch,ist,clen,henc,shttp,unstall,ody"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest trimming this list of ignore words down to the bare minimum needed by this repo. A lot of these words are unique to the main repo, and it's best not to ignore them here. (That way, we catch more spelling mistakes.)

Copy link
Contributor Author

@Josverl Josverl Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have trimmed down the list and moved the wordlist into tools/ignore_words.txt
one word per line , Should help on the tracking changes going forward.
reduced further by adding # codespell:ignore comments for lower frequency cases

pyproject.toml Outdated
skip = """
./.git,\
**/test_*.py,\
**/html.entities/html/entities.py,\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason the tests and this entities file need to be skipped?

Copy link
Contributor Author

@Josverl Josverl Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in the PR :

  • paths adjusted - ignores tests_*.py and html/entities as they have many non-words.

I have now added a configuration to enable disable codespell for blocks of code where it is impractical to repeat on each line.

# This wil be checked

# codespell:ignore-begin

# this won't 

# codespell:ignore-end

tests_
In my earlier validation I found a lot of problems in the tests so decided to exclude all together
now on second look , there were only a few remaining - some of which i fixed and a few that I added # ignores for

Signed-off-by: Jos Verlinde <Jos.Verlinde@Microsoft.com>
Spelling preferences based on codespell configuration.

Signed-off-by: Jos Verlinde <Jos.Verlinde@Microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants