Skip to content

Commit

Permalink
add command descriptions + Go documentation link to CONTRIBUTING.MD
Browse files Browse the repository at this point in the history
  • Loading branch information
XaurDesu committed Feb 3, 2023
1 parent b0f971d commit 920f08e
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions CONTRIBUTING.md
Expand Up @@ -44,26 +44,34 @@ are more sensitive, emailed to <opensource@google.com>.

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

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

1. Please run:
3. Please run:
* `go generate github.com/google/go-github/...`
* `go test github.com/google/go-github/...`
* `go vet github.com/google/go-github/...`

1. Do your best to have [well-formed commit messages][] for each change.
The `go generate ./...` command will update or generate certain files, and the resulting changes should be included in your pull request.

The `go test ./...` command will run tests inside your code. This will help you spot places where code might be faulty before commiting.

And finally, the `go vet ./...` command will check linting and styling over your code, keeping the project consistent formatting-wise.

In any case, it is always a good idea to read official Go documentation when working on this project, as the definition of tools and
commands of the Go programming language is described on further detail there.

4. Do your best to have [well-formed commit messages][] for each change.
This provides consistency throughout the project, and ensures that commit
messages are able to be formatted properly by various git tools.

1. Finally, push the commits to your fork and submit a [pull request][].
5. Finally, push the commits to your fork and submit a [pull request][].
Before pushing commits, it is highly advised to check for generated files
that were either created or modified for the sake of your commit. Running
`go generate -x ./...` should return a log of modified generated files that should
Expand All @@ -72,6 +80,7 @@ are more sensitive, emailed to <opensource@google.com>.
it more difficult for reviewers to see what has changed since the last
code review.

[Go Documentation]: https://pkg.go.dev/std
[forking]: https://help.github.com/articles/fork-a-repo
[golint]: https://github.com/golang/lint
[golint readme]: https://github.com/golang/lint/blob/master/README.md
Expand Down

0 comments on commit 920f08e

Please sign in to comment.