Skip to content

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

Merged
merged 1 commit into from
Oct 9, 2015

Conversation

cristicbz
Copy link
Contributor

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
  • 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.

@rust-highfive
Copy link
Contributor

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is bad

@steveklabnik
Copy link
Member

Thanks so much! This is awesome.

@cristicbz
Copy link
Contributor Author

@steveklabnik Thanks for the review! Should I amend the commit, or add a new one and squash?

@steveklabnik
Copy link
Member

Either way works :)

@cristicbz
Copy link
Contributor Author

Done!

@steveklabnik
Copy link
Member

@bors: r+

@bors
Copy link
Collaborator

bors commented Oct 7, 2015

📌 Commit b31d968 has been approved by steveklabnik

@steveklabnik
Copy link
Member

not gonna roll this one up since it touches many files, might conflict

@bors
Copy link
Collaborator

bors commented Oct 8, 2015

⌛ Testing commit b31d968 with merge 49006b6...

@bors
Copy link
Collaborator

bors commented Oct 8, 2015

⛄ The build was interrupted to prioritize another pull request.

@bors
Copy link
Collaborator

bors commented Oct 8, 2015

🔒 Merge conflict

@bors
Copy link
Collaborator

bors commented Oct 8, 2015

☔ The latest upstream changes (presumably #28897) made this pull request unmergeable. Please resolve the merge conflicts.

@cristicbz
Copy link
Contributor Author

Someone else picked up on one of 'the the'-s. I'll rebase tonight.

@steveklabnik
Copy link
Member

Just ping me after you do, github doesn't send notifications for just rebases

@cristicbz
Copy link
Contributor Author

Rebased!

@alexcrichton
Copy link
Member

@bors: r+ 4b308b4

Thanks!

bors added a commit that referenced this pull request 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.
@bors
Copy link
Collaborator

bors commented Oct 8, 2015

⌛ Testing commit 4b308b4 with merge d0cae14...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants