-
Notifications
You must be signed in to change notification settings - Fork 4.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
Proposal: automatically spell check and fix errors in release notes and changelog #62153
base: trunk
Are you sure you want to change the base?
Conversation
This will catch spelling errors, specially in the changelog, where there are many. This will help us have a better changelog without having to ask contributors to spell check the titles of their PRs.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Thanks for this, @vcanales! I love this as a great safe guard. But I think that I am against automatically fixing any typos. Without human review of any flagged misspellings, we risk incorrect adjustments introducing errors instead of fixing (the opposite of the intention of this PR). The first question that came to mind was how to override the suggested spellings. Where this is a code base, there will likely be "incorrect" spellings that are desired. It looks like there is a way to maintain a false-positive list for a project. I think it would be good to configure this with just "WordPress" in there for now. It's not clear to me if we can enforce proper casing for words. If so, then that would be nice to add as well (WordPress vs. wordpress or Wordpress, etc.). And final thought: would it make more sense to run this more regularly? Or earlier in the process? I know this is specifically for the release notes, but holding up the final release process to fix these at that time is not ideal (those releases can take extended amounts of time if other issues are discovered). |
From a search of
Seems like we can, but we'd have to add a specific rule for each incorrect spelling. As an example, on this content:
And these rules: [default.extend-identifiers]
wordPress = "WordPress"
Wordpress = "WordPress"
WordPres = "WordPress" typos returns: ➜ gutenberg git:(try/spellcheck-release-notes) ✗ typos wordpresses.txt
error: `wordPress` should be `WordPress`
--> wordpresses.txt:1:21
|
1 | wordpress WordPress wordPress woRdPress
| ^^^^^^^^^
|
error: `Wordpress` should be `WordPress`
--> wordpresses.txt:2:1
|
2 | Wordpress
| ^^^^^^^^^
|
error: `wordpres` should be `wordpress`
--> wordpresses.txt:3:1
|
3 | wordpres
| ^^^^^^^^
| For some reason, it misses "WordPres" in the same conditions as above, but adding a rule for it makes it work. The unreasonably bad "
I kind of agree; I went for an auto-fix because I initially thought that the friction by a human review might be enough to turn this into a nuisance rather than an improvement, but perhaps in order to make this a manual process instead we could have a bot comment on PRs with typos on their titles, asking the author to fix them before merging, since the PR title is what makes it into the Change Log. That being said, I think that incorrect adjustments would be fewer than the actual small spelling errors currently present. For reference, I've added what the auto-fix would do to our current change log in |
What?
This PR introduces a spell-checking step for release notes and change log in the GitHub Actions workflow. The action uses crate-ci's typos package under the hood, a CLI utility for spell checking written in rust.
Why?
Adding a spell check ensures that the release notes are free of typos and grammatical errors, helping maintain a professional standard. By automating this process, we can reduce the likelihood of errors slipping through manually written documentation.
The change log currently has a lot of spelling errors — a sample:
This is understandable, and adding this steps makes it so that errors can be corrected without having to depend on the contributor editing their PR title.
How?
The workflow file
.github/workflows/build-plugin-zip.yml
has been updated to include a new step utilizing thecrate-ci/typos
action. This step checks therelease-notes.txt
file for typos and automatically writes changes to correct any found errors.Testing Instructions
Spell check release notes
step runs successfully in the workflow.release-notes.txt
file for any automated corrections made by the spell check.