Code review and Pull requests - cma-open/cmatools GitHub Wiki
Code review strategy:
- Code review will occur during development, iteratively (not at the end of the project)
- All code will be reviewed by at least one other developer / researcher before it reaches the master branch
- Maximum use will be made of automated code checking and testing to help with code reviews (PyCharm "Code Inspect", Sonarcloud, Codacy, and automated running of tests
- The priorities will be:
- code functionality
- clarity of intention
- documentation
- comments
- code style
Process
- Pull requests will be used to initiate a code review
- A reviewer will be assigned to each Pull Request
- THe reviewer must "sign off" whenthe code is ready, or mark if changes are requested
- When ready the code will then be merged back into the master/main branch
- When all review comments have been dealt with and commits have been made, the issue and Pull Request will be closed by the reviewer
Reviewing a Pull Request
- Visit the Pull Request page where you are assigned as a reviewer, you will see a green "Add your review button"
- Summarise your review and then submit
- It is also possible to build up review comments as follows: Click the "files changed" tab in the pull request to view all the changed files. Hover over a line number, a blue square appears - use this to add comments relating to that line
- When you view the main pull request page you will see a summary of all comments
What to review?
- We will follow this review guidance (bearing in mind limitations with current project team size)
- https://github.com/metoppv/improver/wiki/Guidance-for-Reviewing-Code
Info on Pull Requests
https://help.github.com/en/articles/merging-a-pull-request