Skip to content

Commit

Permalink
Code Review Standards for External Contributors (#15)
Browse files Browse the repository at this point in the history
* adds a Code Review Standards for External Contributors section

* add dividing lines

* clean up

* update the Code Line Limit point with suggestions

* add section about unsafe code
  • Loading branch information
JoshuaBatty authored Jan 19, 2023
1 parent 1fc7f3e commit e1906db
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions text/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
- [Security Audits](./code-standards/security-audits.md)
- [SemVer](./code-standards/semver.md)
- [API Design](./code-standards/api-design.md)
- [External Contributors](./code-standards/external-contributors.md)
21 changes: 21 additions & 0 deletions text/code-standards/external-contributors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Code Review Standards for External Contributors

1. __Code Line Limit__: Pull requests should aim to not exceed 500 lines of additions. This helps to ensure that changes are small and easy to review, making it less likely for bugs to be introduced and easier to understand the changes. It also keeps the pull requests manageable in size and reduces the time needed for reviewing and approving.

2. __Code Quality__: Code should be clean, well-organized, and easy to read. It should follow the existing coding style and conventions used in the project. This makes the codebase consistent and easy to understand, which will help to maintain the project over time.

3. __Comments__: Code should be well-documented, providing explanations for the purpose, design, and reasoning of the code. Comments assist in clarifying the intent of the code, making it easier for others to work with and understand, even if they were not familiar with it previously. They also aid in making sure that others can comprehend the modifications made and how they fit into the overall project.

4. __Test Coverage__: All new code should be accompanied by unit tests that thoroughly exercise the new functionality. This helps to ensure that the code is working as intended and will continue to work correctly in the future.

5. __Security__: All code should be checked for potential security vulnerabilities. It is important to make security a top priority and regularly check and test code for any potential vulnerabilities.

6. __Safety > Performance__: Correctness of code must be guaranteed before `unsafe` code will be considered for review. Requests for the inclusion of `unsafe` code should be accompanied by benchmarks that demonstrate a measurable performance improvement, and/or code comments that clearly explain why the `unsafe` code is necessary before the code is considered for review.

7. __PR Submission__: When submitting a pull request, the contributor should provide a clear explanation of the changes made and their motivations behind the proposed modifications. It's recommended to include links to any related open issues in the PR description to make it easy for reviewers to understand the context and the problem that the code is trying to solve.

8. __Sign Off__: All pull requests from external contributors will need to be signed off by at least two internal contributors before they can be merged. This helps to ensure that changes are properly reviewed and that the quality of the codebase is maintained. It also allows for more experienced developers to mentor less experienced ones and help improve their contributions.

9. __Compliance__: All contributions must adhere to the project's open-source license and the contributor must agree to the terms of the license before submitting their code. This helps to ensure that the project stays in compliance with legal and ethical guidelines, and protects the rights of all parties involved.

By following these standards, external contributors can help to ensure that their code is of high-quality and easy to review. Adhering to these standards makes the project more reliable, sustainable, and maintainable in the long run, benefiting the project, community and the contributors.

0 comments on commit e1906db

Please sign in to comment.