Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos discovered by codespell #18387

Closed
wants to merge 4 commits into from
Closed

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Dec 30, 2024

This comment has been minimized.

This comment has been minimized.

Copy link
Collaborator

@cdce8p cdce8p left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I think codespell would be a great addition. Little bit surprised that it didn't find any spelling issues in the changelog though 😄

@@ -100,6 +100,10 @@ force-exclude = '''
^/test-data
'''

[tool.codespell]
ignore-words-list = "ans,ccompiler,corus,fo,froms,haa,hax,notin,ot,statics,whet,zar"
Copy link
Collaborator

Choose a reason for hiding this comment

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

2.3.0 added inline ignores. We should probably use those for single occurrences like froms.

# codespell:ignore froms

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This sounds way too chatty to me. Putting all the config in one place sounds more intuitive and sensible to me.

@@ -100,6 +100,10 @@ force-exclude = '''
^/test-data
'''

[tool.codespell]
ignore-words-list = "ans,ccompiler,corus,fo,froms,haa,hax,notin,ot,statics,whet,zar"
skip = "./mypyc/external/*,*.pyi,*.test"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I do wonder if we should just skip the whole mypy/test/ and mypyc/test folders entirely.

Personally I'd also just move the config to .pre-commit-config.yaml directly. Don't think any one is ever running codespell outside pre-commit.

This also allows us to use the pre-commit files filter as well with exclude_types: [pyi, test] and exclude: ^(mypyc/external/|mypy/test|mypyc/test).

Copy link
Contributor Author

@cclauss cclauss Jan 21, 2025

Choose a reason for hiding this comment

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

Ignoring typos in all tests sounds a bit lazy. I detest those cryptic regex syntaxes and have struggled to make them work when configuring both mypy and black. I much prefer the config of pytest and ruff which do intuitive filtering without ^(|) which might be great for computers to parse but is suboptimal for those of us that do not have a masters degree in computer science.

The point of PEP621 is to concentrate the project config into a canonical file. Some users may choose to run codespell on the command line and it would be a shame if they did so without access to the config that was stored in a hidden file.

This comment has been minimized.

Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@cclauss
Copy link
Contributor Author

cclauss commented Jan 21, 2025

More new typos to fix…

mypy/constraints.py:388: unwraped ==> unwrapped
mypyc/doc/dev-intro.md:389: Debuggging ==> Debugging
mypyc/doc/dev-intro.md:412: Instad ==> Instead
mypyc/test/test_run.py:347: Debuggging ==> Debugging

JukkaL pushed a commit that referenced this pull request Feb 12, 2025
Replaces #18387

Use codespell in pre-commit to detect spelling mistakes, see #18642.
Ignore test and typeshed folders.
@cdce8p
Copy link
Collaborator

cdce8p commented Feb 12, 2025

This has been implemented in

Thanks @cclauss for starting the discussion here!

@cdce8p cdce8p closed this Feb 12, 2025
@cclauss cclauss deleted the codespell branch February 12, 2025 13:46
ericmarkmartin pushed a commit to ericmarkmartin/mypy that referenced this pull request Feb 19, 2025
Replaces python#18387

Use codespell in pre-commit to detect spelling mistakes, see python#18642.
Ignore test and typeshed folders.
ericmarkmartin pushed a commit to ericmarkmartin/mypy that referenced this pull request Feb 19, 2025
Replaces python#18387

Use codespell in pre-commit to detect spelling mistakes, see python#18642.
Ignore test and typeshed folders.
x612skm pushed a commit to x612skm/mypy-dev that referenced this pull request Feb 24, 2025
Replaces python#18387

Use codespell in pre-commit to detect spelling mistakes, see python#18642.
Ignore test and typeshed folders.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants