b3 coding rules updated [message #603731] |
Fri, 16 April 2010 13:36 |
Filip Hrbek Messages: 233 Registered: July 2009 |
Senior Member |
|
|
Hi,
I have updated coding rules (style, cleanup, formatting).
Anyone who is developing b3 bundles should do following:
1) Download new workspace template from http://wiki.eclipse.org/images/2/26/B3_workspace_template_ar chive.zip
2) Create a new workspace from this template
3) Populate b3 source code (note - non-aggregator bundles are temporarily excluded from releng since they are currently unresolvable, rmap needs to be updated)
5) Update all projects from SVN (they will get all necessary project specific settings)
I think that this step is quite important to avoid possible merge conflicts in future.
Good news:
Since Eclipse 3.6M6 there's a new feature in code formatter that I like very much! Developers have been waiting for it since 2002 and finally it's there!
The formatter enables declaration of formatting off/on tags. I set up "@fmtOff" and "@fmtOn" tags in the b3 workspace template. How does it work?
Here's an example:
------
/**
* This code is fully formatted
*/
public void doSomethingUseful(String message) {
// @fmtOff
// This section is not formatted because I like 4 elements
// in each row
private String[] numbers = new String[] {
"One", "Two", "Three", "Four",
"Five", "Six", "Seven", "Eight"
};
// @fmtOn
// TODO This is for debugging only, remove it
// @fmtOff
// This section is not formatted because I don't want to happen
// what you can see in the next example
/*
for(int i=numbers.length-1; i >= 0; i-- {
System.out.println(numbers[i]);
}
*/
// @fmtOn
// This section is formatted which is not good - it is difficult to
// restore the testing code
/*
* for(int i=numbers.length-1; i >= 0; i-- {
* System.out.println(numbers[i]);
* }
*/
}
------
Notes:
If you don't want to keep using your current workspace, it should be enough to extract " .metadata/.plugins/org.eclipse.core.runtime/.settings/org.ec lipse.jdt.ui.prefs " from the template and replace the respective file in your workspace with it (please backup your original file first for case something is wrong with the new one).
Question (for the most active committer, i.e. Henrik):
Can I commit cleaned up sources for everything in b3 that is non-aggregator? I've set up all bundles but I have committed only aggregator related bundles so far.
Everything compiles OK but I don't know how to test the functionality.
Filip
|
|
|
Powered by
FUDForum. Page generated in 0.02145 seconds