PTP adheres to the [http://wiki.eclipse.org/Development_Conventions_and_Guidelines Eclipse Foundation development conventions and guidelines]. Please make sure you read through these before committing code (if you're a committer) or submitting code contributions (if not).

+

PTP follows the standard requirements for working on Eclipse projects Please ensure you have read the [[Development Resources | Eclipse Development Resources]] prior to beginning work.

−

The following practices should also be observed:

+

PTP also adheres to the [[Development_Conventions_and_Guidelines]] Eclipse Foundation development conventions and guidelines]. Please make sure you read through these before committing code (if you're a committer) or submitting code contributions (if not).

−

* All source files must start with an [http://www.eclipse.org/legal/copyrightandlicensenotice.php approved license and copyright declaration]

+

The following practices should also be observed:

−

* All plugins must include an [http://www.eclipse.org/legal/epl/about.php about.html file]

+

−

Additional requirements for Java source:

+

*All source files must start with an [http://www.eclipse.org/legal/copyrightandlicensenotice.php approved license and copyright declaration]

+

*All plugins must include an [http://www.eclipse.org/legal/epl/about.php about.html file]

−

* All interfaces and methods must include a Javadoc comment

+

== Contributions from non-committers ==

−

* Interface implementations must include a non-Javadoc comment

+

−

Additional requirements for C source:

+

Contributions from non-committers should be handled by following these guidelines: [[Development Resources/Handling Git Contributions|Handling Git Contributions]]

−

* All functions must be commented

+

== Java Errors/Warnings ==

−

* Only include header files that are explicitly used

+

−

* Always initialize variables before use (including static)

+

−

* Always test explicitly for NULL

+

−

* Always use NULL for pointers, not 0

+

−

* Always test for an explicit value from strcmp

+

−

C source formatting guidelines:

+

Developers should override default compiler error/warning and use project specific errors/warnings. These errors should be enabled:

−

* Function body '{' and '}' on their own line

+

*Method with a constructor name - Error

−

* Function type on it's own line (including static qualifier)

+

*Non-externalized strings (missing/unused $NON-NLS$ tag) - Warning

−

* Function arguments separated by one space

+

*Assignment has no effect - Error

−

* Functions local to a file should be declared static

+

*Possible accidental boolean assignment - Error

−

* One variable declaration per line

+

*finally does not complete normally - Error

−

* Variable declarations should be followed by a blank line

+

*Using a char array in string concatenation - Error

−

* No spaces before or after '(' and ')' in functions

+

*Null pointer access - Error

−

* Opening brace on same line as last ')' in an if statement expression

+

*Potential null pointer access - Warning

−

* Space separating 'if' and '('

+

*Unused Import - Error

−

* No spaces after '(' or before ')' in if statements

+

−

* No braces around return values

+

−

* Opening brace on same line as 'else'

+

−

* 'else' on same line as '}'

+

−

* Only use '/*' and '*/' for comments

+

−

* Put '/*' and '*/' on their own line for multiline comments

+

−

* Start each line of a multiline comment with an '*' aligned with the '*' in the '/*'

* Add the plugin to the anonymous and committer project sets for HEAD.

+

* Add the plugin to a feature so it gets built (in this case it should be org.eclipse.ptp.core-feature)

+

* Add the plugin to the map file org.eclipse.releng/maps/ptp.map

+

* Add a tagone entry in the tag target in org.eclipse.ptp.releng/build.xml

+

* Add a about.html

+

* Announce on ptp-dev

+

+

There is some documentation on the release engineering here: http://wiki.eclipse.org/PTP/release_engineering

+

+

== Additional requirements for C source ==

+

+

*All functions must be commented

+

*Only include header files that are explicitly used

+

*Always initialize variables before use (including static)

+

*Always test explicitly for NULL

+

*Always use NULL for pointers, not 0

+

*Always test for an explicit value from strcmp

+

*All functions should be declared static unless explicitly exported with an 'extern' prototype in the header file

+

*Filenames should be all lowercase with words separated by '_'

+

+

C source formatting guidelines:

+

+

*Function body '{' and '}' on their own line

+

*Function type on its own line (including static qualifier)

+

*Function arguments separated by one space

+

*Functions local to a file should be declared static

+

*One variable declaration per line

+

*Variable declarations should be followed by a blank line

+

*No spaces before or after '(' and ')' in functions

+

*Opening brace on same line as last ')' in an 'if', 'for', or 'switch' statement expression

+

*Space separating keyword and '('

+

*No spaces after '(' or before ')' in if statements

+

*No braces around return values

+

*Opening brace on same line as 'else'

+

*'else' on same line as '}'

+

*Only use '/*' and '*/' for comments

+

*Put '/*' and '*/' on their own line for multiline comments

+

*Start each line of a multiline comment with an '*' aligned with the '*' in the '/*'

+

+

C naming conventions:

+

+

*Global function and type identifiers:

+

**Capitalize the first letter of each word (e.g.MIBreakpointGetBreakInsertInfo)

+

**Do not use '_' or '-'

+

**Use descriptive names

+

*Local (static) and utility function and type identifiers, and structure field identifiers:

+

**All lowercase

+

**Separate words with '_'

+

**Do not use '-'

+

*Local (static) variables:

+

**Can start with '_'

Revision as of 13:43, 6 May 2013

PTP follows the standard requirements for working on Eclipse projects Please ensure you have read the Eclipse Development Resources prior to beginning work.

PTP also adheres to the Development_Conventions_and_Guidelines Eclipse Foundation development conventions and guidelines]. Please make sure you read through these before committing code (if you're a committer) or submitting code contributions (if not).