-
Notifications
You must be signed in to change notification settings - Fork 0
Backend: Contributing to the source code
This page talks about good development practices and correct developer etiquette. No one likes reading spaghetti code and no one likes debugging someone else's code, so it's your responsibility to only push working, well-tested code online.
As a quick summary, your pre-push ritual should look as follows:
- Make the code changes you need to make, e.g. add a new feature.
- If you need to make any changes to the database, define them using migrations, don't change the database manually! (see Database section in the sidebar for info)
- Write tests for the new feature, and make sure they pass. Don't just test the obvious cases - throw in some edge cases and scenarios where feature is supposed to throw an error.
- Make sure you didn't break any of the other features in the process by running
npm run test-all
and making sure they pass. - Make sure your coding style is correct by running
npm run lint
and fixing any warnings that come up. - Stage the files you changed using Git and write a good, descriptive commit message. If needed, split your changes into several commits.
- Finally, push!
This might seem tedious but this ritual is very much worth it - it means that you'll never have to waste time going back to older commits to fix some overseen bugs.
Make sure to review the Backend > Notes section in the sidebar. It contains useful information about JavaScript and PostgreSQL coding styles, as well as many other useful tips. Before you push any code online, make sure that npm run lint
commands exits without errors or warnings.
We're using ESLint for linting, and chances are your editor has built-in support for it. Check this page to see if your editor can run ESLint automatically.
Coming soon.
Coming soon.
If any of the documentation you see on this page is inaccurate, please create an issue or report it to Tim Kuzhagaliyev at tim.kuzhagaliyev.15 (at) ucl.ac.uk
.
- Meta:
- Tutorials:
- Notes:
- Coming soon.