I'm working on a java project that has some strict code formatting requirements in IntelliJ. I find the preferred format very hard to read to the point it's hurting my efficiency and can't easily review my own code.
I'm looking to find out if there's a way to store two different code format configurations or profiles which I can apply to my code. For example, I'd like to format my code back to "my style" during implementation and debugging, and then format it to the "corporate style" before committing. I'll need to work on the same code across several commits so I'd need to go from one format to the other at will.
Is this possible?
Corporate style, lots of line wraps and spaces:
private boolean scpLocalToRemote (String localIP, String remoteIP, String remoteUser,
String localFilePath, String remoteFilePath) {
String scpCommand = "scp " + localFilePath + " " + remoteUser + "@[" + remoteIP + "]:"
+ remoteFilePath;
log.info("SCP Command: '" + scpCommand + "'");
try {
MyProjectInterfaceUtils.runCommand(scpCommand);
} catch (IOException e) {
log.severe(e.toString());
return false;
}
return true;
}
My style (it's just a development preference, not looking for advice on formatting best-practices):
private boolean scpLocalToRemote(String localIP, String remoteIP, String remoteUser, localFilePath, String remoteFilePath)
{
String scpCommand = "scp " + localFilePath + " " + remoteUser + "@[" + remoteIP + "]:" + remoteFilePath;
log.info("SCP Command: '" + scpCommand + "'");
try
{
MyProjectInterfaceUtils.runCommand(scpCommand);
}
catch(IOException e)
{
log.severe(e.toString());
return false;
}
return true;
}