Skip to content

Commit 8afdf89

Browse files
author
Kate Osborn
committed
Add links to code style guide
1 parent 4a09894 commit 8afdf89

File tree

2 files changed

+17
-44
lines changed

2 files changed

+17
-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

docs/developer/implementing-a-feature.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,21 @@ practices to ensure a successful feature development process.
1717
the [branching and workflow](/docs/developer/branching-and-workflow.md) documentation.
1818
4. **Branch**: Create a branch following
1919
the [naming conventions](/docs/developer/branching-and-workflow.md#branch-naming-conventions).
20-
5. **Make changes**: Make the necessary changes for the feature.
21-
6. **Consider opening a draft PR**: If your feature involves substantial architecture changes, or you would like to
20+
5. **Review style guide** Review the [Go style guide](/docs/developer/go-style-guide.md) to familiarize yourself with
21+
the project's coding practices.
22+
6. **Make changes**: Make the necessary changes for the feature.
23+
7. **Consider opening a draft PR**: If your feature involves substantial architecture changes, or you would like to
2224
receive early feedback, consider opening a draft PR and requesting reviews from the maintainers. Draft PRs are an
2325
effective means to solicit feedback and ensure that major architectural changes align with the project's goals and
2426
standards.
25-
7. **Add or update unit tests** All features **must** be accompanied by unit tests that verify the functionality. Make
27+
8. **Add or update unit tests** All features **must** be accompanied by unit tests that verify the functionality. Make
2628
sure to thoroughly test the different scenarios and edge cases related to the feature to ensure robustness and
2729
reliability. Additionally, open the code coverage report to ensure that the code you added has sufficient test
2830
coverage. For instructions on writing and running unit tests, refer to
2931
the [testing](/docs/developer/testing.md#unit-test-guidelines) documentation.
30-
8. **Manually verify your changes**: Refer to the [manual testing](/docs/developer/testing.md#manual-testing) section of
32+
9. **Manually verify your changes**: Refer to the [manual testing](/docs/developer/testing.md#manual-testing) section of
3133
the testing documentation for instructions on how to manually test your changes.
32-
9. **Update any relevant documentation**: Here are some guidelines for updating documentation:
34+
10. **Update any relevant documentation**: Here are some guidelines for updating documentation:
3335
- **Gateway API Feature**: If you are implementing a Gateway API feature, make sure to update
3436
the [Gateway API Compatibility](/docs/gateway-api-compatibility.md) documentation.
3537
- **New Use Case:** If your feature introduces a new use case, add an example of how to use it in
@@ -41,22 +43,20 @@ practices to ensure a successful feature development process.
4143
- **Other Documentation Updates**: For any other changes that affect the behavior, usage, or configuration of NKG,
4244
review the existing documentation and update it as necessary. Ensure that the documentation remains accurate and
4345
up to date with the latest changes.
44-
10. **Lint code**: See the [run the linter](/docs/developer/quickstart.md#run-the-linter) section of the quickstart
46+
11. **Lint code**: See the [run the linter](/docs/developer/quickstart.md#run-the-linter) section of the quickstart
4547
guide for instructions.
46-
11. **Open pull request**: Open a pull request targeting the `main` branch of
48+
12. **Open pull request**: Open a pull request targeting the `main` branch of
4749
the [nginx-kubernetes-gateway](https://github.com/nginxinc/nginx-kubernetes-gateway/tree/main) repository. The
4850
entire `nginx-kubernetes-gateway` group will be automatically requested for review. If you have a specific or
4951
different reviewer in mind, you can request them as well. Refer to
5052
the [pull request](/docs/developer/pull-request.md) documentation for expectations and guidelines.
51-
12. **Obtain the necessary approvals**: Work with code reviewers to maintain the required number of approvals.
52-
13. **Squash and merge**: Squash your commits locally, or use the GitHub UI to squash and merge. Only one commit per
53+
13. **Obtain the necessary approvals**: Work with code reviewers to maintain the required number of approvals.
54+
14. **Squash and merge**: Squash your commits locally, or use the GitHub UI to squash and merge. Only one commit per
5355
pull request should be merged. Make sure the first line of the final commit message includes the pull request
5456
number. For example, Fix supported gateway conditions in compatibility doc (#674).
5557
> **Note**:
5658
When you squash commits, make sure to not include any commit messages related to the code review
5759
(for example, Fixed a typo). If you changed the code as a result of the code review in way that the original commit message no longer describes it well, make sure to update the message.
58-
59-
6060

6161
## Fixing a Bug
6262

0 commit comments

Comments
 (0)