Given the following IF statement in Apex code:
if (ctr > 10)
failed = true;
Format Code will change the Apex source into this, stripping the indentation:
if (ctr > 10)
failed = true;
It should give one of the following, in this preferred order:
- Keep the original indentation
if (ctr > 10) failed = true;
- Merge the two lines into a single line
if (ctr > 10) failed = true;
- Add curly braces
if (ctr > 10) { failed = true; }
My team inherited an application with hundreds of thousands of lines, and we cannot use Format Code on the source unless we modify every IF statement by hand, so the indentation is visually correct after formatting.
If the template for Format Code was made available, I could fix it myself. But apparently there is no way for you to expose the template...?