Uh oh!
There was an error while loading. Please reload this page.
Fix a grabbag of semi-automatically found typos throughout the codebase - #28900
Conversation
rust-highfive
commented
Oct 7, 2015
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. |
steveklabnik
commented
Oct 7, 2015
Thanks so much! This is awesome. |
cristicbz
commented
Oct 7, 2015
@steveklabnik Thanks for the review! Should I amend the commit, or add a new one and squash? |
steveklabnik
commented
Oct 7, 2015
Either way works :) |
cristicbz
commented
Oct 7, 2015
Done! |
steveklabnik
commented
Oct 7, 2015
@bors: r+ |
bors
commented
Oct 7, 2015
📌 Commit b31d968 has been approved by |
steveklabnik
commented
Oct 7, 2015
not gonna roll this one up since it touches many files, might conflict |
bors
commented
Oct 8, 2015
⌛ Testing commit b31d968 with merge 49006b6... |
bors
commented
Oct 8, 2015
⛄ The build was interrupted to prioritize another pull request. |
bors
commented
Oct 8, 2015
🔒 Merge conflict |
bors
commented
Oct 8, 2015
☔ The latest upstream changes (presumably #28897) made this pull request unmergeable. Please resolve the merge conflicts. |
cristicbz
commented
Oct 8, 2015
Someone else picked up on one of 'the the'-s. I'll rebase tonight. |
steveklabnik
commented
Oct 8, 2015
Just ping me after you do, github doesn't send notifications for just rebases |
cristicbz
commented
Oct 8, 2015
Rebased! |
alexcrichton
commented
Oct 8, 2015
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.txtfrom 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.