Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Papyrus/Code Standards"
< Papyrus
(→Coding rules for Papyrus plug-ins and features) |
(→Tests) |
||
Line 55: | Line 55: | ||
<br> | <br> | ||
[[Image:Papyrus.Build.properties-selectedOptions.png]] | [[Image:Papyrus.Build.properties-selectedOptions.png]] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:Papyrus]] | [[Category:Papyrus]] |
Revision as of 10:16, 17 September 2020
Coding rules for Papyrus plug-ins and features
These rules apply to all plug-ins and features developed for the Papyrus Eclipse project, and distributed under the EPL licence.
Java classes
- All APIs must be documented with JavaDoc comments. Automatic generation of JavaDoc comments may help, but the automatically generated comments are templates. They are not sufficient. It is better not to generate javadoc comments than to generate empty comments.
- No abbreviations - the class, methods and variables should have meaningful names
- Formatting - the code should be formatted in accordance with format templates
- Always use brackets in conditions, loops, ...
- Compile - the modified code and other plugins should be compilable. Be sure to use Java 1.5 code compatibility. Check other plugins that could be influenced before commiting!
- Standard Java Rules coding - Unless specified differently, the Java Standard Coding rules should be applied: no abbreviations, variables starting with lower case; class and types with upper case; Composed name separated with upper case; no underscore in names; ...
- Each Java class must contain the Copyright/Licence/Contributor header. e.g.:
/*****************************************************************************
* Copyright (c) 2016 CEA LIST.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
*****************************************************************************/
- You must not use the standard console output in Papyrus plug-ins. Use the Papyrus log instead
- In case of doubt - check existing code from those following the rules :-)
Features
- ID:
- Main Papyrus components: org.eclipse.papyrus.<feature.name>.feature
- e.g. org.eclipse.papyrus.infra.core.feature
- Extra components: org.eclipse.papyrus.extra.<feature.name>.feature
- e.g. org.eclipse.papyrus.extra.marte.feature
- Main Papyrus components: org.eclipse.papyrus.<feature.name>.feature
- Name: Papyrus <Feature Name> (Incubation)
- e.g. Papyrus core (Incubation)
- e.g. Papyrus Marte (Incubation)
- Each feature must contain the files epl-v10.html and license.html (April 9, 2014)
- The build.properties file must contain the following files in the "Binary build" section:
- epl-v10.html
- feature.properties (When available)
- feature.xml
- licence.html
- The build.properties file must contain the following files in the "Source build" section:
- build.properties (Optional)
- epl-v10.html
- licence.html