mbed-os
Fork of mbed-os by
features/FEATURE_LWIP/lwip-interface/lwip/doc/contrib.txt@1:3deb71413561, 2017-07-20 (annotated)
- Committer:
- xuaner
- Date:
- Thu Jul 20 14:26:57 2017 +0000
- Revision:
- 1:3deb71413561
- Parent:
- 0:f269e3021894
mbed_os
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
elessair | 0:f269e3021894 | 1 | 1 Introduction |
elessair | 0:f269e3021894 | 2 | |
elessair | 0:f269e3021894 | 3 | This document describes some guidelines for people participating |
elessair | 0:f269e3021894 | 4 | in lwIP development. |
elessair | 0:f269e3021894 | 5 | |
elessair | 0:f269e3021894 | 6 | 2 How to contribute to lwIP |
elessair | 0:f269e3021894 | 7 | |
elessair | 0:f269e3021894 | 8 | Here is a short list of suggestions to anybody working with lwIP and |
elessair | 0:f269e3021894 | 9 | trying to contribute bug reports, fixes, enhancements, platform ports etc. |
elessair | 0:f269e3021894 | 10 | First of all as you may already know lwIP is a volunteer project so feedback |
elessair | 0:f269e3021894 | 11 | to fixes or questions might often come late. Hopefully the bug and patch tracking |
elessair | 0:f269e3021894 | 12 | features of Savannah help us not lose users' input. |
elessair | 0:f269e3021894 | 13 | |
elessair | 0:f269e3021894 | 14 | 2.1 Source code style: |
elessair | 0:f269e3021894 | 15 | |
elessair | 0:f269e3021894 | 16 | 1. do not use tabs. |
elessair | 0:f269e3021894 | 17 | 2. indentation is two spaces per level (i.e. per tab). |
elessair | 0:f269e3021894 | 18 | 3. end debug messages with a trailing newline (\n). |
elessair | 0:f269e3021894 | 19 | 4. one space between keyword and opening bracket. |
elessair | 0:f269e3021894 | 20 | 5. no space between function and opening bracket. |
elessair | 0:f269e3021894 | 21 | 6. one space and no newline before opening curly braces of a block. |
elessair | 0:f269e3021894 | 22 | 7. closing curly brace on a single line. |
elessair | 0:f269e3021894 | 23 | 8. spaces surrounding assignment and comparisons. |
elessair | 0:f269e3021894 | 24 | 9. don't initialize static and/or global variables to zero, the compiler takes care of that. |
elessair | 0:f269e3021894 | 25 | 10. use current source code style as further reference. |
elessair | 0:f269e3021894 | 26 | |
elessair | 0:f269e3021894 | 27 | 2.2 Source code documentation style: |
elessair | 0:f269e3021894 | 28 | |
elessair | 0:f269e3021894 | 29 | 1. JavaDoc compliant and Doxygen compatible. |
elessair | 0:f269e3021894 | 30 | 2. Function documentation above functions in .c files, not .h files. |
elessair | 0:f269e3021894 | 31 | (This forces you to synchronize documentation and implementation.) |
elessair | 0:f269e3021894 | 32 | 3. Use current documentation style as further reference. |
elessair | 0:f269e3021894 | 33 | |
elessair | 0:f269e3021894 | 34 | 2.3 Bug reports and patches: |
elessair | 0:f269e3021894 | 35 | |
elessair | 0:f269e3021894 | 36 | 1. Make sure you are reporting bugs or send patches against the latest |
elessair | 0:f269e3021894 | 37 | sources. (From the latest release and/or the current Git sources.) |
elessair | 0:f269e3021894 | 38 | 2. If you think you found a bug make sure it's not already filed in the |
elessair | 0:f269e3021894 | 39 | bugtracker at Savannah. |
elessair | 0:f269e3021894 | 40 | 3. If you have a fix put the patch on Savannah. If it is a patch that affects |
elessair | 0:f269e3021894 | 41 | both core and arch specific stuff please separate them so that the core can |
elessair | 0:f269e3021894 | 42 | be applied separately while leaving the other patch 'open'. The prefered way |
elessair | 0:f269e3021894 | 43 | is to NOT touch archs you can't test and let maintainers take care of them. |
elessair | 0:f269e3021894 | 44 | This is a good way to see if they are used at all - the same goes for unix |
elessair | 0:f269e3021894 | 45 | netifs except tapif. |
elessair | 0:f269e3021894 | 46 | 4. Do not file a bug and post a fix to it to the patch area. Either a bug report |
elessair | 0:f269e3021894 | 47 | or a patch will be enough. |
elessair | 0:f269e3021894 | 48 | If you correct an existing bug then attach the patch to the bug rather than creating a new entry in the patch area. |
elessair | 0:f269e3021894 | 49 | 5. Patches should be specific to a single change or to related changes. Do not mix bugfixes with spelling and other |
elessair | 0:f269e3021894 | 50 | trivial fixes unless the bugfix is trivial too. Do not reorganize code and rename identifiers in the same patch you |
elessair | 0:f269e3021894 | 51 | change behaviour if not necessary. A patch is easier to read and understand if it's to the point and short than |
elessair | 0:f269e3021894 | 52 | if it's not to the point and long :) so the chances for it to be applied are greater. |
elessair | 0:f269e3021894 | 53 | |
elessair | 0:f269e3021894 | 54 | 2.4 Platform porters: |
elessair | 0:f269e3021894 | 55 | |
elessair | 0:f269e3021894 | 56 | 1. If you have ported lwIP to a platform (an OS, a uC/processor or a combination of these) and |
elessair | 0:f269e3021894 | 57 | you think it could benefit others[1] you might want discuss this on the mailing list. You |
elessair | 0:f269e3021894 | 58 | can also ask for Git access to submit and maintain your port in the contrib Git module. |