Skip to content

Commit 493b233

Browse files
authored
Use single space after period. (#549)
This commit was largely generated by: perl -i -npe 's,^(\s*// .+[a-z]\.) +([A-Z]),$1 $2,' $(git grep -l -E '^\s*//(.+\.) +([A-Z])') With additional manual followups to catch the few remaining missed cases, such as inside non-go files, spaces after question marks, etc. Fixes #548.
1 parent 30a21ee commit 493b233

40 files changed

+146
-146
lines changed

CONTRIBUTING.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# How to contribute #
22

3-
We'd love to accept your patches and contributions to this project. There are
3+
We'd love to accept your patches and contributions to this project. There are
44
a just a few small guidelines you need to follow.
55

66

77
## Contributor License Agreement ##
88

99
Contributions to any Google project must be accompanied by a Contributor
10-
License Agreement. This is not a copyright **assignment**, it simply gives
10+
License Agreement. This is not a copyright **assignment**, it simply gives
1111
Google permission to use and redistribute your contributions as part of the
12-
project. Head over to <https://cla.developers.google.com/> to see your current
12+
project. Head over to <https://cla.developers.google.com/> to see your current
1313
agreements on file or to sign a new one.
1414

1515
You generally only need to submit a CLA once, so if you've already submitted one
@@ -20,25 +20,25 @@ again.
2020
## Submitting a patch ##
2121

2222
1. It's generally best to start by opening a new issue describing the bug or
23-
feature you're intending to fix. Even if you think it's relatively minor,
24-
it's helpful to know what people are working on. Mention in the initial
23+
feature you're intending to fix. Even if you think it's relatively minor,
24+
it's helpful to know what people are working on. Mention in the initial
2525
issue that you are planning to work on that bug or feature so that it can
2626
be assigned to you.
2727

2828
1. Follow the normal process of [forking][] the project, and setup a new
29-
branch to work in. It's important that each group of changes be done in
29+
branch to work in. It's important that each group of changes be done in
3030
separate branches in order to ensure that a pull request only includes the
3131
commits related to that bug or feature.
3232

3333
1. Go makes it very simple to ensure properly formatted code, so always run
34-
`go fmt` on your code before committing it. You should also run
35-
[golint][] over your code. As noted in the [golint readme][], it's not
34+
`go fmt` on your code before committing it. You should also run
35+
[golint][] over your code. As noted in the [golint readme][], it's not
3636
strictly necessary that your code be completely "lint-free", but this will
3737
help you find common style issues.
3838

39-
1. Any significant changes should almost always be accompanied by tests. The
39+
1. Any significant changes should almost always be accompanied by tests. The
4040
project already has good test coverage, so look at some of the existing
41-
tests if you're unsure how to go about it. [gocov][] and [gocov-html][]
41+
tests if you're unsure how to go about it. [gocov][] and [gocov-html][]
4242
are invaluable tools for seeing which parts of your code aren't being
4343
exercised by your tests.
4444

@@ -61,12 +61,12 @@ again.
6161
## Other notes on code organization ##
6262

6363
Currently, everything is defined in the main `github` package, with API methods
64-
broken into separate service objects. These services map directly to how
64+
broken into separate service objects. These services map directly to how
6565
the [GitHub API documentation][] is organized, so use that as your guide for
6666
where to put new methods.
6767

6868
Code is organized in files also based pretty closely on the GitHub API
69-
documentation, following the format `{service}_{api}.go`. For example, methods
69+
documentation, following the format `{service}_{api}.go`. For example, methods
7070
defined at <https://developer.github.com/v3/repos/hooks/> live in
7171
[repos_hooks.go][].
7272

@@ -88,18 +88,18 @@ exceptions, running `git log` should not show a bunch of branching and merging.
8888

8989
Never use the GitHub "merge" button, since it always creates a merge commit.
9090
Instead, check out the pull request locally ([these git aliases
91-
help][git-aliases]), then cherry-pick or rebase them onto master. If there are
91+
help][git-aliases]), then cherry-pick or rebase them onto master. If there are
9292
small cleanup commits, especially as a result of addressing code review
93-
comments, these should almost always be squashed down to a single commit. Don't
94-
bother squashing commits that really deserve to be separate though. If needed,
93+
comments, these should almost always be squashed down to a single commit. Don't
94+
bother squashing commits that really deserve to be separate though. If needed,
9595
feel free to amend additional small changes to the code or commit message that
9696
aren't worth going through code review for.
9797

9898
If you made any changes like squashing commits, rebasing onto master, etc, then
9999
GitHub won't recognize that this is the same commit in order to mark the pull
100-
request as "merged". So instead, amend the commit message to include a line
101-
"Fixes #0", referencing the pull request number. This would be in addition to
102-
any other "Fixes" lines for closing related issues. If you forget to do this,
100+
request as "merged". So instead, amend the commit message to include a line
101+
"Fixes #0", referencing the pull request number. This would be in addition to
102+
any other "Fixes" lines for closing related issues. If you forget to do this,
103103
you can also leave a comment on the pull request [like this][rebase-comment].
104104
If you made any other changes, it's worth noting that as well, [like
105105
this][modified-comment].

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030

3131
Some documentation is taken from the GitHub Developer site
3232
<http://developer.github.com/>, which is available under the following Creative
33-
Commons Attribution 3.0 License. This applies only to the go-github source
33+
Commons Attribution 3.0 License. This applies only to the go-github source
3434
code and would not apply to any compiled binaries.
3535

3636
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE

examples/basicauth/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// license that can be found in the LICENSE file.
55

66
// The basicauth command demonstrates using the github.BasicAuthTransport,
7-
// including handling two-factor authentication. This won't currently work for
7+
// including handling two-factor authentication. This won't currently work for
88
// accounts that use SMS to receive one-time passwords.
99
package main
1010

@@ -36,7 +36,7 @@ func main() {
3636
client := github.NewClient(tp.Client())
3737
user, _, err := client.Users.Get("")
3838

39-
// Is this a two-factor auth error? If so, prompt for OTP and try again.
39+
// Is this a two-factor auth error? If so, prompt for OTP and try again.
4040
if _, ok := err.(*github.TwoFactorAuthError); err != nil && ok {
4141
fmt.Print("\nGitHub OTP: ")
4242
otp, _ := r.ReadString('\n')

github/activity_star.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@ func (s *ActivityService) ListStargazers(owner, repo string, opt *ListOptions) (
4949
// ActivityListStarredOptions specifies the optional parameters to the
5050
// ActivityService.ListStarred method.
5151
type ActivityListStarredOptions struct {
52-
// How to sort the repository list. Possible values are: created, updated,
53-
// pushed, full_name. Default is "full_name".
52+
// How to sort the repository list. Possible values are: created, updated,
53+
// pushed, full_name. Default is "full_name".
5454
Sort string `url:"sort,omitempty"`
5555

56-
// Direction in which to sort repositories. Possible values are: asc, desc.
56+
// Direction in which to sort repositories. Possible values are: asc, desc.
5757
// Default is "asc" when sort is "full_name", otherwise default is "desc".
5858
Direction string `url:"direction,omitempty"`
5959

6060
ListOptions
6161
}
6262

63-
// ListStarred lists all the repos starred by a user. Passing the empty string
63+
// ListStarred lists all the repos starred by a user. Passing the empty string
6464
// will list the starred repositories for the authenticated user.
6565
//
6666
// GitHub API docs: http://developer.github.com/v3/activity/starring/#list-repositories-being-starred

github/activity_watching.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func (s *ActivityService) ListWatchers(owner, repo string, opt *ListOptions) ([]
4646
return watchers, resp, nil
4747
}
4848

49-
// ListWatched lists the repositories the specified user is watching. Passing
49+
// ListWatched lists the repositories the specified user is watching. Passing
5050
// the empty string will fetch watched repos for the authenticated user.
5151
//
5252
// GitHub API Docs: https://developer.github.com/v3/activity/watching/#list-repositories-being-watched
@@ -77,7 +77,7 @@ func (s *ActivityService) ListWatched(user string, opt *ListOptions) ([]*Reposit
7777
}
7878

7979
// GetRepositorySubscription returns the subscription for the specified
80-
// repository for the authenticated user. If the authenticated user is not
80+
// repository for the authenticated user. If the authenticated user is not
8181
// watching the repository, a nil Subscription is returned.
8282
//
8383
// GitHub API Docs: https://developer.github.com/v3/activity/watching/#get-a-repository-subscription

github/authorizations.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func (a AuthorizationRequest) String() string {
114114
// AuthorizationUpdateRequest represents a request to update an authorization.
115115
//
116116
// Note that for any one update, you must only provide one of the "scopes"
117-
// fields. That is, you may provide only one of "Scopes", or "AddScopes", or
117+
// fields. That is, you may provide only one of "Scopes", or "AddScopes", or
118118
// "RemoveScopes".
119119
//
120120
// GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization

github/git_commits.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type Commit struct {
3030
URL *string `json:"url,omitempty"`
3131
Verification *SignatureVerification `json:"verification,omitempty"`
3232

33-
// CommentCount is the number of GitHub comments on the commit. This
33+
// CommentCount is the number of GitHub comments on the commit. This
3434
// is only populated for requests that fetch GitHub data like
3535
// Pulls.ListCommits, Repositories.ListCommits, etc.
3636
CommentCount *int `json:"comment_count,omitempty"`
@@ -40,7 +40,7 @@ func (c Commit) String() string {
4040
return Stringify(c)
4141
}
4242

43-
// CommitAuthor represents the author or committer of a commit. The commit
43+
// CommitAuthor represents the author or committer of a commit. The commit
4444
// author may not correspond to a GitHub User.
4545
type CommitAuthor struct {
4646
Date *time.Time `json:"date,omitempty"`

github/git_tags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type Tag struct {
2020
Verification *SignatureVerification `json:"verification,omitempty"`
2121
}
2222

23-
// createTagRequest represents the body of a CreateTag request. This is mostly
23+
// createTagRequest represents the body of a CreateTag request. This is mostly
2424
// identical to Tag with the exception that the object SHA and Type are
2525
// top-level fields, rather than being nested inside a JSON object.
2626
type createTagRequest struct {

github/git_trees.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func (t Tree) String() string {
1717
return Stringify(t)
1818
}
1919

20-
// TreeEntry represents the contents of a tree structure. TreeEntry can
20+
// TreeEntry represents the contents of a tree structure. TreeEntry can
2121
// represent either a blob, a commit (in the case of a submodule), or another
2222
// tree.
2323
type TreeEntry struct {
@@ -62,7 +62,7 @@ type createTree struct {
6262
Entries []TreeEntry `json:"tree"`
6363
}
6464

65-
// CreateTree creates a new tree in a repository. If both a tree and a nested
65+
// CreateTree creates a new tree in a repository. If both a tree and a nested
6666
// path modifying that tree are specified, it will overwrite the contents of
6767
// that tree with the new path contents and write a new tree out.
6868
//

github/github.go

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ type Client struct {
106106
clientMu sync.Mutex // clientMu protects the client during calls that modify the CheckRedirect func.
107107
client *http.Client // HTTP client used to communicate with the API.
108108

109-
// Base URL for API requests. Defaults to the public GitHub API, but can be
110-
// set to a domain endpoint to use with GitHub Enterprise. BaseURL should
109+
// Base URL for API requests. Defaults to the public GitHub API, but can be
110+
// set to a domain endpoint to use with GitHub Enterprise. BaseURL should
111111
// always be specified with a trailing slash.
112112
BaseURL *url.URL
113113

@@ -178,7 +178,7 @@ type RawOptions struct {
178178
Type RawType
179179
}
180180

181-
// addOptions adds the parameters in opt as URL query parameters to s. opt
181+
// addOptions adds the parameters in opt as URL query parameters to s. opt
182182
// must be a struct whose fields may contain "url" tags.
183183
func addOptions(s string, opt interface{}) (string, error) {
184184
v := reflect.ValueOf(opt)
@@ -200,8 +200,8 @@ func addOptions(s string, opt interface{}) (string, error) {
200200
return u.String(), nil
201201
}
202202

203-
// NewClient returns a new GitHub API client. If a nil httpClient is
204-
// provided, http.DefaultClient will be used. To use API methods which require
203+
// NewClient returns a new GitHub API client. If a nil httpClient is
204+
// provided, http.DefaultClient will be used. To use API methods which require
205205
// authentication, provide an http.Client that will perform the authentication
206206
// for you (such as that provided by the golang.org/x/oauth2 library).
207207
func NewClient(httpClient *http.Client) *Client {
@@ -235,7 +235,7 @@ func NewClient(httpClient *http.Client) *Client {
235235

236236
// NewRequest creates an API request. A relative URL can be provided in urlStr,
237237
// in which case it is resolved relative to the BaseURL of the Client.
238-
// Relative URLs should always be specified without a preceding slash. If
238+
// Relative URLs should always be specified without a preceding slash. If
239239
// specified, the value pointed to by body is JSON encoded and included as the
240240
// request body.
241241
func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error) {
@@ -295,14 +295,14 @@ func (c *Client) NewUploadRequest(urlStr string, reader io.Reader, size int64, m
295295
return req, nil
296296
}
297297

298-
// Response is a GitHub API response. This wraps the standard http.Response
298+
// Response is a GitHub API response. This wraps the standard http.Response
299299
// returned from GitHub and provides convenient access to things like
300300
// pagination links.
301301
type Response struct {
302302
*http.Response
303303

304304
// These fields provide the page values for paginating through a set of
305-
// results. Any or all of these may be set to the zero value for
305+
// results. Any or all of these may be set to the zero value for
306306
// responses that are not part of a paginated set, or for which there
307307
// are no additional pages.
308308

@@ -384,7 +384,7 @@ func parseRate(r *http.Response) Rate {
384384
}
385385

386386
// Rate specifies the current rate limit for the client as determined by the
387-
// most recent API call. If the client is used in a multi-user application,
387+
// most recent API call. If the client is used in a multi-user application,
388388
// this rate may not always be up-to-date.
389389
//
390390
// Deprecated: Use the Response.Rate returned from most recent API call instead.
@@ -396,11 +396,11 @@ func (c *Client) Rate() Rate {
396396
return rate
397397
}
398398

399-
// Do sends an API request and returns the API response. The API response is
399+
// Do sends an API request and returns the API response. The API response is
400400
// JSON decoded and stored in the value pointed to by v, or returned as an
401-
// error if an API error has occurred. If v implements the io.Writer
401+
// error if an API error has occurred. If v implements the io.Writer
402402
// interface, the raw response body will be written to v, without attempting to
403-
// first decode it. If rate limit is exceeded and reset time is in the future,
403+
// first decode it. If rate limit is exceeded and reset time is in the future,
404404
// Do returns *RateLimitError immediately without making a network API call.
405405
func (c *Client) Do(req *http.Request, v interface{}) (*Response, error) {
406406
rateLimitCategory := category(req.URL.Path)
@@ -511,7 +511,7 @@ func (r *ErrorResponse) Error() string {
511511
}
512512

513513
// TwoFactorAuthError occurs when using HTTP Basic Authentication for a user
514-
// that has two-factor authentication enabled. The request can be reattempted
514+
// that has two-factor authentication enabled. The request can be reattempted
515515
// by providing a one-time password in the request.
516516
type TwoFactorAuthError ErrorResponse
517517

@@ -609,7 +609,7 @@ func (e *Error) Error() string {
609609
// present. A response is considered an error if it has a status code outside
610610
// the 200 range or equal to 202 Accepted.
611611
// API error responses are expected to have either no response
612-
// body, or a JSON response body that maps to ErrorResponse. Any other
612+
// body, or a JSON response body that maps to ErrorResponse. Any other
613613
// response body will be silently ignored.
614614
//
615615
// The error type will be *RateLimitError for rate limit exceeded errors,
@@ -658,15 +658,15 @@ func CheckResponse(r *http.Response) error {
658658
// parseBoolResponse determines the boolean result from a GitHub API response.
659659
// Several GitHub API methods return boolean responses indicated by the HTTP
660660
// status code in the response (true indicated by a 204, false indicated by a
661-
// 404). This helper function will determine that result and hide the 404
662-
// error if present. Any other error will be returned through as-is.
661+
// 404). This helper function will determine that result and hide the 404
662+
// error if present. Any other error will be returned through as-is.
663663
func parseBoolResponse(err error) (bool, error) {
664664
if err == nil {
665665
return true, nil
666666
}
667667

668668
if err, ok := err.(*ErrorResponse); ok && err.Response.StatusCode == http.StatusNotFound {
669-
// Simply false. In this one case, we do not pass the error through.
669+
// Simply false. In this one case, we do not pass the error through.
670670
return false, nil
671671
}
672672

@@ -692,15 +692,15 @@ func (r Rate) String() string {
692692

693693
// RateLimits represents the rate limits for the current client.
694694
type RateLimits struct {
695-
// The rate limit for non-search API requests. Unauthenticated
696-
// requests are limited to 60 per hour. Authenticated requests are
695+
// The rate limit for non-search API requests. Unauthenticated
696+
// requests are limited to 60 per hour. Authenticated requests are
697697
// limited to 5,000 per hour.
698698
//
699699
// GitHub API docs: https://developer.github.com/v3/#rate-limiting
700700
Core *Rate `json:"core"`
701701

702-
// The rate limit for search API requests. Unauthenticated requests
703-
// are limited to 10 requests per minutes. Authenticated requests are
702+
// The rate limit for search API requests. Unauthenticated requests
703+
// are limited to 10 requests per minutes. Authenticated requests are
704704
// limited to 30 per minute.
705705
//
706706
// GitHub API docs: https://developer.github.com/v3/search/#rate-limit
@@ -838,7 +838,7 @@ func (t *UnauthenticatedRateLimitedTransport) transport() http.RoundTripper {
838838
}
839839

840840
// BasicAuthTransport is an http.RoundTripper that authenticates all requests
841-
// using HTTP Basic Authentication with the provided username and password. It
841+
// using HTTP Basic Authentication with the provided username and password. It
842842
// additionally supports users who have two-factor authentication enabled on
843843
// their GitHub account.
844844
type BasicAuthTransport struct {

0 commit comments

Comments
 (0)