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

Use the third person in method docs #6778

Merged
merged 4 commits into from
Sep 25, 2018
Merged

Conversation

wooster0
Copy link
Contributor

There are some methods left that don't use the third person.

@vladfaust
Copy link
Contributor

In my projects I always use no-person references in the method introduction and then the third person in description. E.g:

# Set foo to bar. May raise. Uploads to server.
def foo
end

So in the docs summary it says Set foo to bar and in the full description there is a third person reference to the described method.

Which approach is right?

@wooster0
Copy link
Contributor Author

According to Documenting code you should always document methods in the third person:

  • Use the third person: Returns the number of horns this unicorn has instead of Return the number of horns this unicorn has.

src/array.cr Outdated
@@ -190,7 +190,7 @@ class Array(T)
size <=> other.size
end

# Set intersection: returns a new `Array` containing elements common to `self`
# Sets intersection: returns a new `Array` containing elements common to `self`
Copy link
Contributor

Choose a reason for hiding this comment

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

This is actually a noun, not a verb. ("Set intersection", as in the intersection of two sets)

Same below on the next diff line for this file

Copy link
Contributor

@RX14 RX14 left a comment

Choose a reason for hiding this comment

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

Rest is good

@@ -83,7 +83,7 @@ module Crystal
# one LLVM module is created for each type in a program.
property? single_module = false

# Set to a `ProgressTracker` object which tracks compilation progress.
# Sets to a `ProgressTracker` object which tracks compilation progress.
Copy link
Contributor

Choose a reason for hiding this comment

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

This was correct before, although badly worded (my docs, sorry)

@@ -110,7 +110,7 @@ module Crystal
# The main filename of this program
property filename : String?

# Set to a `ProgressTracker` object which tracks compilation progress.
# Sets to a `ProgressTracker` object which tracks compilation progress.
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@RX14 RX14 added the kind:bug A bug in the code. Does not apply to documentation, specs, etc. label Sep 25, 2018
@RX14 RX14 added this to the 0.27.0 milestone Sep 25, 2018
@RX14 RX14 merged commit 8344df1 into crystal-lang:master Sep 25, 2018
ezrast pushed a commit to ezrast/crystal that referenced this pull request Oct 2, 2018
* Use the third person

* Remove the s from 2 nouns

* Remove 2 s'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. kind:docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants