From c26669b137d01cba9304c34cd0c625d4fc4a2520 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Mon, 18 May 2026 13:22:30 +0300 Subject: [PATCH] docs: Formatting and punctuation changes --- CONTRIBUTING.md | 18 +++++++++--------- README.md | 2 +- scrape/README.md | 14 +++++++------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1c3d86f7a4d..c9f7df2c994 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,10 +18,10 @@ again. ## Reporting issues Bugs, feature requests, and development-related questions should be directed to -our [GitHub issue tracker](https://github.com/google/go-github/issues). If +our [GitHub issue tracker](https://github.com/google/go-github/issues). If reporting a bug, please try and provide as much context as possible such as your operating system, Go version, and anything else that might be relevant to -the bug. For feature requests, please explain what you're trying to do, and +the bug. For feature requests, please explain what you're trying to do, and how the requested feature would help you do that. Security related bugs can either be reported in the issue tracker, or if they @@ -163,9 +163,9 @@ Every exported method and type needs to have code comments that follow // //meta:operation GET /repos/{owner}/{repo} func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Repository, *Response, error) { - u := fmt.Sprintf("repos/%v/%v", owner, repo) - req, err := s.client.NewRequest(ctx, "GET", u, nil) - ... + u := fmt.Sprintf("repos/%v/%v", owner, repo) + req, err := s.client.NewRequest(ctx, "GET", u, nil) + // ... } ``` And the returned type `Repository` will have comments like this: @@ -173,10 +173,10 @@ And the returned type `Repository` will have comments like this: ```go // Repository represents a GitHub repository. type Repository struct { - ID *int64 `json:"id,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Owner *User `json:"owner,omitempty"` - ... + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Owner *User `json:"owner,omitempty"` + // ... } ``` diff --git a/README.md b/README.md index 54a70ff536f..8dd5737c79b 100644 --- a/README.md +++ b/README.md @@ -314,7 +314,7 @@ is recommended, ex: ```go import ( "github.com/bartventer/httpcache" - _ "github.com/bartventer/httpcache/store/memcache" // Register the in-memory backend + _ "github.com/bartventer/httpcache/store/memcache" // Register the in-memory backend ) client, err := github.NewClient(github.WithHTTPClient(httpcache.NewClient("memcache://")), github.WithAuthToken(os.Getenv("GITHUB_TOKEN"))) diff --git a/scrape/README.md b/scrape/README.md index 25ca4a2308e..5396c940f49 100644 --- a/scrape/README.md +++ b/scrape/README.md @@ -1,26 +1,26 @@ [![Go Reference](https://pkg.go.dev/badge/github.com/google/go-github/scrape.svg)](https://pkg.go.dev/github.com/google/go-github/scrape) The scrape package provides an experimental client for accessing additional -GitHub data via screen scraping. It is designed to be a client of last resort +GitHub data via screen scraping. It is designed to be a client of last resort for data that cannot be retrieved via the REST or GraphQL APIs. # What should be added here -**Add only what you need.** Whereas the main go-github library attempts to +**Add only what you need.** Whereas the main go-github library attempts to implement the entire GitHub REST API, there is little point in trying to do that -here. Certainly, feel free to contribute patches to get data you actually +here. Certainly, feel free to contribute patches to get data you actually need, but I'd rather not try and provide exhaustive coverage of all GitHub data here. -**Add only what can't be accessed elsewhere.** If the data can be retrieved +**Add only what can't be accessed elsewhere.** If the data can be retrieved through the REST or GraphQL API, use the appropriate libraries for that. -**Prefer read-only access.** For now, I'm only focusing on reading data. It +**Prefer read-only access.** For now, I'm only focusing on reading data. It might be that writing works fine as well, but it is of course much riskier. # How to add methods -See [apps.go](apps.go) for examples of methods that access data. Basically, +See [apps.go](apps.go) for examples of methods that access data. Basically, fetch the contents of the page using `client.get`, and then use goquery to dig -into the markup on the page. Prefer selectors that grab semantic ID or class +into the markup on the page. Prefer selectors that grab semantic ID or class names, as they are more likely to be stable.