-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Standardize spelling to American English in documentation #9804
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we configure codespell in any way to catch this in the future? We're already using it as pre-commit hook
Thanks for review and suggestion @browniebroke !
Can we configure codespell in any way to catch this in the future?
That would be great if we configured. I have done small research and i found codespell project directly addresses the British-to-American spelling standardization . The maintainers merged a change to include a dedicated en_GB_to_en_US dictionary (related to codespell-project/codespell/pull/1480). This dictionary is specifically designed to flag common British spellings (like the ones I corrected: initialise, behaviour, etc.) as typos.
for maximum coverage we can also use this regex i found in the discussion.
f4e1eaf to
f2f5d86
Compare
I tried locally
by adding args: ["--builtin", "clear,rare,en-GB_to_en-US"] in codespell section.
- repo: https://github.com/codespell-project/codespell
# Configuration for codespell is in .codespellrc
rev: v2.4.1
hooks:
- id: codespell
args: ["--builtin", "clear,rare,en-GB_to_en-US"]
exclude: locale|kickstarter-announcement.md|coreapi-0.1.1.js
additional_dependencies:
# python doesn't come with a toml parser prior to 3.11
- "tomli; python_version < '3.11'"
I got following results:
codespell_error
I would love to work on the configuring codespell hook. Can i raise Seperate PR ? if yes, then which file to be ignored for now?
Can i raise Seperate PR ? if yes, then which file to be ignored for now?
Yes, sure. Fine by me
I got following results: codespell_error
@browniebroke If you go through the image, It detect other words too which i haven't detect in the PR. So Should i update those too ? So It will be in one go.
Also I want to mention that spelling errors were ignored in python code by codespell .
It detect those spelling errors only in the "comments" of python files and ".md" files.
It detect other words too which i haven't detect in the PR. So Should i update those too ? So It will be in one go.
If you want to, sure. Thinking about it again. Would be nice to update codespell config so it's all done in one go as well... This all feels very much related. Fixing the problem and setting us up for no further changes. Same spirit as updating tests as your fix a bug.
Also I want to mention that spelling errors were ignored in python code. It detect those spelling errors only in the "comments" of python files and ".md" files.
👍🏻 Noted
...tency changes: - Activates the `en-GB_to_en-US` built-in dictionary to flag British spellings - Created codespell-ignore-words.txt file to ignore specific words - include `code` and `names` for comprehensive typo checking in technical contexts. - changed the 'lets' to 'let's'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
According to DRF language-style the documentation should follow the american english style.
But I have found some British style words or inconsistent spellings like
behaviour,customise,initialise,e-mail,Sub-classesin the docs. In this PR I have modified them to DRF style.I have touched 26 files. and I can understand this is relatively large change. I'm not sure whether DRF team will like my approach or not. but if anything is there I'm happy to adjust.
Note:
highlight.pack.jswere intentionally not modified.