Skip to content
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

Edits to punctuation to conform to style guide #141

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dmvj
Copy link

@dmvj dmvj commented Jun 3, 2023

Fixing punctuation around code examples to conform to the style guide. Only punctuation has changed.

@xwu
Copy link
Contributor

xwu commented Jun 3, 2023

I rather like that code examples are introduced by colons; this seems the more intuitive usage for me as a reader. Can we conform the style guide to the actual usage instead?

@dmvj
Copy link
Author

dmvj commented Jun 3, 2023

Can we conform the style guide to the actual usage instead?

That's exactly why I posted over at the Swift Forums. It doesn't matter to me either way. I did notice, though, that newer additions to sections tended to conform more closely to the present style guide. So, either way, there's some cleanup to be done. I'm happy to go in either direction. I just need to know which one. :)

@amartini51 amartini51 marked this pull request as draft June 7, 2023 16:05
@amartini51
Copy link
Member

amartini51 commented Jul 24, 2023

The following comments are from Susan (one of our editors), who reviewed this PR today.

The punctuation/wording, etc is fine, except for these few instances where colons are needed below:

The following example reports a compile-time error.

let i = 1

Should be:

The following example reports a compile-time error: (use a colon because the sentence both directly references and precedes the code snippet.)

let i = 1

And the others (changed here):

However, the alternative example below is valid:

let i = 1

The example below uses the initializer to try to convert a String into an Int:

let possibleNumber = "123"

Write an optional binding for an if statement as follows:

if let <#constantName#> = <#someOptional#> {

The following if statements are equivalent:

if let firstNumber = Int("4"), let secondNumber = Int("42"), firstNumber < secondNumber && secondNumber < 100 {

The rubric is: ONLY use colons when the sentence preceding the code snippet directly references that code; otherwise use a period.

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.

3 participants