-
Notifications
You must be signed in to change notification settings - Fork 1
Development Guidelines
Hanyuan Li edited this page Jun 15, 2022
·
2 revisions
Some guidelines for project development:
- Follow the style guide for the language you're writing in - e.g.
snake_case
for function names in Python,camelCase
in JavaScript. - Write comments! It not only helps when other people read your code, but when you read code that you wrote a while ago.
- Follow the commit format outlined in Conventional Commits, specifically the "commit message with scope" section. We should try and use
feat:
,fix:
andmerge
to delineate different types of commits (and make our commit messages seem more readable), but the rest doesn't need to be followed super strictly. - Make a separate branch for each feature (e.g. for one page, for adding a specific feature, for adding a list of backend routes), and make sure all code in the
main
branch is bug-free. - Get at least one person to review your code before merging a pull request.
- Do test-driven development (especially for backend), with testing as black-box as you can get.
- Check the coverage of your tests!
- Sometimes making tests completely black-box may be inconvenient (e.g. instead of adding a user directly into a database to test for repeating usernames, black-box testing dictates we have to access the
register
endpoint, which involves sending a verification email, checking for emails etc.), in which case the test doesn't have to be completely black-box.