forked from micropython/micropython-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
ContributorGuidelines
Paul Sokolovsky edited this page Oct 20, 2015
·
9 revisions
This is placeholder for contributor guidelines.
- Golden rule: Please do "git log"/"git log -p" and follow the same approach with your changes. Some specifics:
- One changed module/package per commit.
- Every commit message starts with "<module>: "
- Each module's
setup.py
is autogenerated frommetadata.txt
bymake_metadata.py
script, so please make changes to metadata.txt, runmake_metadata.py
and then commit bothmetadata.txt
andsetup.py
. - Name something
test_*.py
only if it's a real unittest (which will checks results itself and will fail if there's error). Otherwise if human should check test results, name itexample_*.py
- We follow PEP8, except for over-tight line length limits. Lines up to 90 chars are OK. If there're good reasons, a line can be longer (consider 132 to be hard limit).
When porting a module from CPython or other 3rd-party source:
- Do some research to find suitable source. CPython 3.3 stdlib should still be considered as a base version to take modules from, as more recent versions has some modules bloated, which isn't really good direction for MicroPython. (But again, try to look at different versions and sources beyond CPython (e.g. PyPy) to find the best.)
- Start with committing 3rd-party source as-is, clearly stating in commit message from where it was taken (exact version, preferrably with URL to tarball, or VCS revision, preferrably with URL to it).
- Follow up with your changes as a next commit.
- When making your changes, the criteria should be minimizing size of a diff. Change as few lines as possible, within lines, don't change more chars than needed. Prefer commenting out to removal of lines. Don't fix typos, formatting, etc. - if you want them to be fixed, submit patches directly to upstream.
- Prefer taking (and porting) tests from CPython rather than duplicating effort and making your own.