Community
Participate
Working Groups
@@@ Code Formatter @@@ I'd like to the "Code Formatter" to have the following features (individually turned on/off): 1. Pre-/suffixes instance variables with a user defined pre-/suffix; in case of a prefix the following rules apply: "ab" and "Ab" (a: first letter of the name; following letters) are exchanged with "pA" (p: the prefix). turned on/off on two levels: instance & class (!! all references in other sources should be adjusted !!) 2. Convert constants, i.e. "final"s, into "All Caps"; the following pattern: "aBa" (a, b: abitrary letters) should be exchanged with "A_BA"; the conversion should be turned on/off on two levels: instance & class (!! all references in other sources should be adjusted !!) 3. Capitalize class names; !! all references in other sources should be adjusted !! 4. Decapitalize first letter on variable and method names; turned on/off individually Report all conflicts to the user and let him decide ... //Before public class test { private char character; private int number; protected int Number; public int PublicNumber; private final constant; public static final classConstant; public test() {} public void TestFunction() { int Number; } public int getNumber() { return number; } } //After //(1) both turned on; instance - user defined prefix "f"; class - user defined suffix "_" //(2) both turned on //(4) both turned on public class Test {// (3) to uppercase !! necessary to change all references !! private char fCharacter; // (1) instance - added prefix private int number; // (1) instance - report to user, two variable's names differing only in capitalization should be not allowed anyway protected int Number; // (4) variable and (1) instance - report to user, two variable's names differing only in capitalization should be not allowed anyway public int publicNumber_; // (4) variable and (1) class - added prefix !! necessary to change all references !! private final CONSTANT;// (2) to uppercase public static final CLASS_CONSTANT; // (2) to uppercase and "aBa"-pattern changed to "A_BA" !! necessary to change all references !! public Test() {} // (3) to uppercase public void testFunction() { // (4) method - changed first letter int number; // (4) variable - changed first letter } public int getNumber() { return fNumber; // (1) added prefix } } @@@@@@ Sebastian Davids
I do not think this is the formatter job to ensure coding conventions. The formatter is simply pretty printing the source code, not altering it (changing names or so).
I agree with Philippe Mulet 2001-12-03 08:53 ------- this is NOT the responsibility of the Code Formatter.
What (existing?) plugin would the belong to then? I agree with the point "Code Formatter == Code Layouter" (i.e. only change of whitespaces) ...
Closing. No change planned.
.