2023-03-27 09:31:02 +02:00
|
|
|
(contributing-code-review)=
|
2018-07-31 12:36:16 -07:00
|
|
|
|
2023-03-27 09:31:02 +02:00
|
|
|
# Code Review guidelines
|
2018-07-31 12:36:16 -07:00
|
|
|
|
|
|
|
|
This document outlines general guidelines to follow when you are making
|
|
|
|
|
or reviewing a Pull Request.
|
|
|
|
|
|
2023-03-27 09:31:02 +02:00
|
|
|
## Have empathy
|
2018-07-31 12:36:16 -07:00
|
|
|
|
2023-03-27 09:31:02 +02:00
|
|
|
We recommend reading [On Empathy & Pull Requests](https://slack.engineering/on-empathy-pull-requests-979e4257d158)
|
|
|
|
|
and [How about code reviews](https://slack.engineering/how-about-code-reviews-2695fb10d034)
|
2018-07-31 12:36:16 -07:00
|
|
|
to learn more about being empathetic in code reviews.
|
|
|
|
|
|
2023-03-27 09:31:02 +02:00
|
|
|
## Write documentation
|
2018-07-31 12:36:16 -07:00
|
|
|
|
|
|
|
|
If your pull request touches any code, you must write or update documentation
|
|
|
|
|
for it. For this project, documentation is a lot more important than the code.
|
2023-03-27 09:31:02 +02:00
|
|
|
If a feature is not documented, it does not exist. If a behavior is not documented,
|
|
|
|
|
it is a bug.
|
2018-07-31 12:36:16 -07:00
|
|
|
|
|
|
|
|
Do not worry about having perfect documentation! Documentation improves over
|
|
|
|
|
time. The requirement is to have documentation before merging a pull request,
|
2023-03-27 09:31:02 +02:00
|
|
|
not to have _perfect_ documentation before merging a pull request. If you
|
2018-07-31 12:59:24 -07:00
|
|
|
are new and not sure how to add documentation, other contributors will
|
|
|
|
|
be happy to guide you.
|
2018-07-31 12:36:16 -07:00
|
|
|
|
2023-03-27 09:31:02 +02:00
|
|
|
See {ref}`contributing/docs` for guidelines on writing documentation.
|
2018-07-31 12:36:16 -07:00
|
|
|
|
2023-03-27 09:31:02 +02:00
|
|
|
## Write tests
|
2018-07-31 12:36:16 -07:00
|
|
|
|
|
|
|
|
If your pull request touches any code, you must write unit or integration tests
|
|
|
|
|
to exercise it. This helps validate & communicate that your pull request works
|
|
|
|
|
the way you think it does. It also makes sure you do not accidentally break
|
|
|
|
|
other code, and makes it harder for future pull requests to break the code
|
|
|
|
|
added in your pull request.
|
|
|
|
|
|
|
|
|
|
Since TLJH is a distribution that integrates many JupyterHub components,
|
|
|
|
|
integration tests provide more value for effort than unit tests do. Unit
|
|
|
|
|
tests are easier to write & faster to run, so if the code being changed
|
|
|
|
|
feels exhaustively unit-testable, write unit tests too. When in doubt,
|
2018-07-31 12:59:24 -07:00
|
|
|
add more tests.
|
|
|
|
|
|
|
|
|
|
If you are unsure what kind of tests to add for your pull request, other
|
2018-08-12 08:57:03 -07:00
|
|
|
contributors to the repo will be happy to help guide you!
|
|
|
|
|
|
2023-03-27 09:31:02 +02:00
|
|
|
See {ref}`contributing/tests` for guidelines on writing tests.
|