-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix a grabbag of semi-automatically found typos throughout the codebase #28900
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
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pcwalton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@@ -51,12 +51,12 @@ pub struct TocEntry { | |||
#[derive(PartialEq)] | |||
pub struct TocBuilder { | |||
top_level: Toc, | |||
/// The current hierarchy of parent headings, the levels are | |||
/// In the current hierarchy of parent headings, the levels are |
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.
This change is bad
Thanks so much! This is awesome. |
@steveklabnik Thanks for the review! Should I amend the commit, or add a new one and squash? |
Either way works :) |
Done! |
@bors: r+ |
📌 Commit b31d968 has been approved by |
not gonna roll this one up since it touches many files, might conflict |
⌛ Testing commit b31d968 with merge 49006b6... |
⛄ The build was interrupted to prioritize another pull request. |
🔒 Merge conflict |
☔ The latest upstream changes (presumably #28897) made this pull request unmergeable. Please resolve the merge conflicts. |
Someone else picked up on one of 'the the'-s. I'll rebase tonight. |
Just ping me after you do, github doesn't send notifications for just rebases |
Rebased! |
I found these automatically, but fixed them manually to ensure the semantics are correct. I know things like these are hardly important, since they only marginally improve clarity. But at least for me typos and simple grammatical errors trigger an---unjustified---sense of unprofessionalism, despite the fact that I make them all the time and I understand that they're the sort of thing that is bound to slip through review. Anyway, to find most of these I used: * `ag '.*//.*(\b[A-Za-z]{2,}\b) \1\b'` for repeated words * `ag '\b(the|this|those|these|a|it) (a|the|this|those|these|it)\b'` to find constructs like 'the this' etc. many false positives, but not too hard to scroll through them to actually find the mistakes. * `cat ../../typos.txt | paste -d'|' - - - - - - - - - - - - - - - - - - - - - - | tr '\n' '\0' | xargs -0 -P4 -n1 ag`. Hacky way to find misspellings, but it works ok. I got `typos.txt` from [Wikipedia](https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines) * `ag '.*//.* a ([ae][a-z]|(o[^n])|(i[a-rt-z]))'` to find places where 'a' was followed by a vowel (requiring 'an' instead). I also used a handful more one off regexes that are too boring to reproduce here.
I found these automatically, but fixed them manually to ensure the semantics are correct. I know things like these are hardly important, since they only marginally improve clarity. But at least for me typos and simple grammatical errors trigger an---unjustified---sense of unprofessionalism, despite the fact that I make them all the time and I understand that they're the sort of thing that is bound to slip through review.
Anyway, to find most of these I used:
ag '.*//.*(\b[A-Za-z]{2,}\b) \1\b'
for repeated wordsag '\b(the|this|those|these|a|it) (a|the|this|those|these|it)\b'
to find constructs like 'the this' etc. many false positives, but not too hard to scroll through them to actually find the mistakes.cat ../../typos.txt | paste -d'|' - - - - - - - - - - - - - - - - - - - - - - | tr '\n' '\0' | xargs -0 -P4 -n1 ag
. Hacky way to find misspellings, but it works ok. I gottypos.txt
from Wikipediaag '.*//.* a ([ae][a-z]|(o[^n])|(i[a-rt-z]))'
to find places where 'a' was followed by a vowel (requiring 'an' instead).I also used a handful more one off regexes that are too boring to reproduce here.