-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Request: Spelling check #1628
Comments
@charliermarsh could we just port over typos, or is it too rust specific? |
I think the best option would be to try and integrate typos as a library (https://docs.rs/typos/0.10.6/typos/). Not sure if the API is amenable to that. |
(That is: call the typos functions directly in Rust, rather than using the CLI, and report typos as Ruff errors.) |
I have been thinking about this for a while and I think we should keep spell checking separate from Ruff for the following reasons:
|
Yeah that makes sense. Let's pass on this for now. |
Regarding 2, I think spell checkers can benefit greatly from parsing Python code. For example, say I've installed a lib from PyPI that has typos on its function names. There's nothing I can do about them, they're outside my control, but I'll need to type the typos if I want to use these functions. A normal spell checker, that treats everything as plain text, would see the typo and complain about it. But again, there's nothing I can do about them. If the spell checker understands Python, it'll be able to tell what's my fault and what's outside my control, and so if the typo is on something from an external lib, it can ignore them, as I can't control that, but if the typo is on my own functions and variable names, it can then warn me. |
There are seemingly two big Python code checkers:
pyspelling
andcodespell
. Codespell doesn't catch everything, and pyspelling is slow to run. It'd be great to have a version / implementation of the logic of these (eventually including PySpelling's exception syntax etc) inruff
.The text was updated successfully, but these errors were encountered: