Skip to content

Commit 175f3bf

Browse files
authored
Add go generate mention to CONTRIBUTING.md (#2587)
Fixes: #2579.
1 parent e26cdd7 commit 175f3bf

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

CONTRIBUTING.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ are more sensitive, emailed to <[email protected]>.
4444

4545
1. Go makes it very simple to ensure properly formatted code, so always run
4646
`go fmt` on your code before committing it. You should also run
47-
[golint][] over your code. As noted in the [golint readme][], it's not
48-
strictly necessary that your code be completely "lint-free", but this will
49-
help you find common style issues.
47+
[go vet][] over your code. this will help you find common style issues
48+
within your code and will keep styling consistent within the project.
5049

5150
1. Any significant changes should almost always be accompanied by tests. The
5251
project already has good test coverage, so look at some of the existing
@@ -59,18 +58,35 @@ are more sensitive, emailed to <[email protected]>.
5958
* `go test github.com/google/go-github/...`
6059
* `go vet github.com/google/go-github/...`
6160

61+
The `go generate ./...` command will update or generate certain files, and the
62+
resulting changes should be included in your pull request.
63+
64+
The `go test ./...` command will run tests inside your code. This will help you
65+
spot places where code might be faulty before committing.
66+
67+
And finally, the `go vet ./...` command will check linting and styling over your
68+
code, keeping the project consistent formatting-wise.
69+
70+
In any case, it is always a good idea to read [official Go documentation][] when working
71+
on this project, as the definition of tools and commands of the Go programming
72+
language is described in further detail there.
73+
6274
1. Do your best to have [well-formed commit messages][] for each change.
6375
This provides consistency throughout the project, and ensures that commit
6476
messages are able to be formatted properly by various git tools.
6577

6678
1. Finally, push the commits to your fork and submit a [pull request][].
79+
Before pushing commits, it is highly advised to check for generated files
80+
that were either created or modified for the sake of your commit. Running
81+
`go generate -x ./...` should return a log of modified generated files that should
82+
be included alongside the manually written code in the commit.
6783
**NOTE:** Please do not use force-push on PRs in this repo, as it makes
6884
it more difficult for reviewers to see what has changed since the last
6985
code review.
7086

87+
[official Go documentation]: https://pkg.go.dev/std
7188
[forking]: https://help.github.com/articles/fork-a-repo
72-
[golint]: https://github.com/golang/lint
73-
[golint readme]: https://github.com/golang/lint/blob/master/README.md
89+
[go vet]: https://pkg.go.dev/cmd/vet
7490
[gocov]: https://github.com/axw/gocov
7591
[gocov-html]: https://github.com/matm/gocov-html
7692
[well-formed commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
@@ -128,4 +144,5 @@ this][modified-comment].
128144
[rebase-comment]: https://github.com/google/go-github/pull/277#issuecomment-183035491
129145
[modified-comment]: https://github.com/google/go-github/pull/280#issuecomment-184859046
130146

131-
**When creating a release, don't forget to update the `Version` constant in `github.go`.** This is used to send the version in the `User-Agent` header to identify clients to the GitHub API.
147+
**When creating a release, don't forget to update the `Version` constant in `github.go`.** This is used to
148+
send the version in the `User-Agent` header to identify clients to the GitHub API.

0 commit comments

Comments
 (0)