Skip to content

Latest commit

 

History

History
39 lines (22 loc) · 3.69 KB

CONTRIBUTING.md

File metadata and controls

39 lines (22 loc) · 3.69 KB

Contributing code to ODK Collect

This is a living document. If you see something that could be improved, edit this document and submit a pull request following the instructions below!

Submitting a pull request

To contribute code to ODK Collect, you will need to open a pull request which will be reviewed by the community and then merged into the core project.

  1. Set up your development environment.

  2. To make sure you have the latest version of the code, set up this repository as a remote for your fork and then sync your fork.

  3. Create a branch for the code you will be writing:

     git checkout -b NAME_OF_YOUR_BRANCH
    
  4. If there is an issue corresponding to what you will work on, comment on it to say you are addressing it.

  5. Once you've made an incremental progress towards you goal and are ready to commit, reformat all Java code using Android Studio and official codestyle.

  6. Commit your changes with a meaningful commit message. Use keywords for closing issues to refer to issues and have them automatically close when your changes are merged.

     git commit -m "Do a thing. Fix #1."
    
  7. Push changes to your fork to make them publicly available:

     git push
    
  8. When your changes are ready to be added to the core ODK Collect project, open a pull request. Make sure to set the base fork to opendatakit/collect. Describe your changes in the comment, refer to any relevant issues using keywords for closing issues and tag any person you think might need to know about the changes.

Style guidelines

For now, match the style of the code in the file you are editing. When creating new files, follow the Android style rules.

Strings

Always use string resources instead of literal strings. This ensures wording consistency across the project and also enables full translation of the app. Only make changes to the base res/values/strings.xml English file and not to the other language files. The translated files are generated from Transifex where translations can be submitted by the community. Names of software packages or other untranslatable strings should be placed in res/values/untranslated.xml.

Code from external sources

ODK Collect is released under the Apache 2.0 license. Please make sure that any code you include is an OSI-approved permissive license. Please note that if no license is specified for a piece of code or if it has an incompatible license such as GPL, using it puts the project at legal risk.

Sites with compatible licenses (including StackOverflow) will sometimes provide exactly the code snippet needed to solve a problem. You are encouraged to use such snippets in ODK Collect as long as you attribute them by including a direct link to the source. In addition to complying with the content license, this provides useful context for anyone reading the code.