Page:
Developer Guide
1
Developer Guide
Manish edited this page 2020-05-11 20:15:17 +10:00
Table of Contents
If you face difficulty following this guide than submit a pull request and work through the feedbacks until PR is accepted.
Pull Request Checklist
- Lint code with flake8
- Run all tests with meta test script
- Write own contribution test, include it in pull request and in meta-test script
Style Guide
See Sugar Labs python, JavaScript and web style guide as well.
- Casing: camelCase . Simply because it is the most common casing convention with JS users and found it in most Sugar Labs repositories.
- Naming convention:
- Full name preferred over abbreviations/cryptic names unless very obvious
- Name intent instead of process
- File size: Splitting code into smaller files is preferred. Easier to navigate following tree/hierarchy and less intimidating to readers.
- No minification: As per sugar labs style guide, HTML, CSS and JS should not be minified. If using any templating than make sure page generated are readable and conform to project style guide.
Testing/Quality Assurance
See Sugar Labs python coverage guide as well.
- If you encounter any bug/regression during development. Write it down and write test for it after done with task at hand.
- Update tests affected by your changes.
- Write own code changes/addition test.
Writing Unit Tests Process
- First write test case in plain English. Take corner cases into account.
- Prepare sample/test data input and output/expected result
- Write unit test
- Ensure maximum possible/practical coverage of test
- Include test case as comment in test code. Include test data input and output as well in PR if relevant.