Skip to content

Commit 8195442

Browse files
authored
Add Go style guide (#679)
Problem: The project's coding style guidelines are undocumented. Solution: Add a Go style guide to the developer docs and link to it in the developer guide and the implementing a feature guide.
1 parent 5fbfb7c commit 8195442

File tree

3 files changed

+489
-44
lines changed

3 files changed

+489
-44
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ considering contributing!
1414
* [Issues and Discussions](#issues-and-discussions)
1515
* [Development Guide](#development-guide)
1616

17-
[Style Guides](#style-guides)
18-
19-
* [Git Style Guide](#git-style-guide)
20-
* [Go Style Guide](#go-style-guide)
21-
2217
[Code of Conduct](CODE_OF_CONDUCT.md)
2318

2419
[Contributor License Agreement](#contributor-license-agreement)
@@ -74,8 +69,8 @@ template.
7469
#### Issue lifecycle
7570

7671
When an issue or PR is created, it will be triaged by the maintainers and assigned a label to indicate the type of issue
77-
it is (bug, feature request, etc) and to determine the milestone. See the [Issue Lifecycle](/ISSUE_LIFECYCLE.md) document
78-
for more information.
72+
it is (bug, feature request, etc) and to determine the milestone. See the [Issue Lifecycle](/ISSUE_LIFECYCLE.md)
73+
document for more information.
7974

8075
### Development Guide
8176

@@ -85,36 +80,14 @@ Before beginning development, familiarize yourself with the following documents:
8580
your development environment and executing tasks required when submitting a pull request.
8681
- [Branching and Workflow](/docs/developer/branching-and-workflow.md): This document outlines the project's specific
8782
branching and workflow practices, including instructions on how to name a branch.
88-
- [Implement a Feature](/docs/developer/implementing-a-feature.md): A step-by-step guide on how to implement a feature or
89-
bug.
83+
- [Implement a Feature](/docs/developer/implementing-a-feature.md): A step-by-step guide on how to implement a feature
84+
or bug.
9085
- [Testing](/docs/developer/testing.md): The project's testing guidelines, includes both unit testing and manual testing
9186
procedures. This document explains how to write and run unit tests, and how to manually verify changes.
9287
- [Pull Request Guidelines](/docs/developer/pull-request.md): A guide for both pull request submitters and reviewers,
9388
outlining guidelines and best practices to ensure smooth and efficient pull request processes.
94-
95-
## Style Guides
96-
97-
### Git Style Guide
98-
99-
* Keep a clean, concise and meaningful git commit history on your branch, rebasing locally and squashing before
100-
submitting a PR
101-
* Follow the guidelines of writing a good commit message as described [here](https://chris.beams.io/posts/git-commit/)
102-
and summarized in the next few points
103-
* In the subject line, use the present tense ("Add feature" not "Added feature")
104-
* In the subject line, use the imperative mood ("Move cursor to..." not "Moves cursor to...")
105-
* Limit the subject line to 72 characters or less
106-
* Reference issues and pull requests liberally after the subject line
107-
* Add more detailed description in the body of the git message (`git commit -a` to give you more space and time in
108-
your text editor to write a good message instead of `git commit -am`)
109-
110-
### Go Style Guide
111-
112-
* Run `gofmt` over your code to automatically resolve a lot of style issues. Most editors support this running
113-
automatically when saving a code file.
114-
* Run `go lint` and `go vet` on your code too to catch any other issues.
115-
* Follow this guide on some good practice and idioms for Go - https://github.com/golang/go/wiki/CodeReviewComments
116-
* To check for extra issues, install [golangci-lint](https://github.com/golangci/golangci-lint) and run `make lint`
117-
or `golangci-lint run`
89+
- [Go Style Guide](/docs/developer/go-style-guide.md) A coding style guide for Go. Contains best practices and
90+
conventions to follow when writing Go code for the project.
11891

11992
## Contributor License Agreement
12093

0 commit comments

Comments
 (0)