Please use pull requests to contribute to the project.
If you are unfamiliar with GitHub, read the DRMF guide.
This is an example of a good pull request.
This pull request satisfies the following properties:
-
It is small/incremental.
-
It improves the readability of the code.
-
It adds more tests.
-
It demonstrates how to add issues for aspects that can be fixed later.
PyCharm is recommended for Python development. For other languages, their respective JetBrains IDEs should be used.
All Python code should be written for Python 2.7, and should follow PEP-8 conventions. In PyCharm, code can be reformatted to follow some PEP-8 conventions, using Code -> Reformat Code. Be warned, Reformat Code will not fix all issues. In addition, PyCharm will warn you about code that violates PEP-8 standards.
Code in other languages should follow standard conventions for that language.
All important code meant for use should have unit tests written for them. In Python, this can be achieved through the built-in unittest
module.
Ideally, unit tests should cover every single possibility, every input and outcome, every line of code. A more realistic goal is "90%" coverage. Coverage can be checked through Coveralls. The idea is that, by the time code gets to production, there should be no possibility of unexpected output, since all possible types of inputs should have been tested.
Unit tests should be stored in a separate "test" folder.
Please follow the instructions here on how to write git commit messages.
PyCharm can help resolve merge conflicts. To resolve conflicts in your project, navigate to VCS -> Git -> Resolve Conflicts. Merge conflicts can also be resolved manually, through the steps in this guide.
Code should be stored in a "src" folder.
All Python source files should have __author__
and __status__
set to the author's name and development status - either "Prototype", for the most basic, incomplete code, "Development", for code that is currently being worked on, and "Production" for code that is ready to be used without any changes. If there were multiple people working on the code, also set __credits__
to a Python list of people who have worked on the code.
All subprojects must have README.md files. A guide may be found here. Note that some of these requirements may not make sense to put in your README.md.
Make good use of .gitignore. Anything that has been generated by code in the repository (compiled code, test files, test output, etc.) should be in your .gitignore. The easiest way to do this is to move these files into a folder, and gitignore that folder.