Coding standards and best practices

We follow these practices when developing RapidSMS code:

  1. Work on a branch off the develop branch.
  2. Follow PEP8 style conventions. Use 4 spaces instead of tabs.
  3. Run the PEP 8 adherence tool.
  4. Use CapitalizedCase for class names, underscored_words for method names.
  5. Code using os.path must be Windows and ‘NIX friendly. For example, don’t use backslashes (\) as path separators.
  6. Be sure every class and method has docstrings.
  7. Use Python logging whenever an error or exception occurs. Optionally include debug-level logging.
  8. Write a test which shows that the bug was fixed or that the feature works as expected.
  9. Run the RapidSMS core test suite to make sure nothing unexpected broke. We only accept pull requests with passing tests.
  10. Write new or update existing documentation to describe the changes you made.
  11. Add the change to the release notes document for the next release. The release notes should focus on the effects on existing users, particularly if it will require them to make changes.
  12. Submit a pull request and get reviews before merging your changes, even if you have authority to merge the changes yourself.
  13. Sign the Contributor License Agreement.