Hi Céline. I do understand the rationale for having checkstyle rules and a common format, and I understand that they are not blocking, but the main issue why I started this thread is that some of those checkstyle rules are inconsistent with the formatting preferences, and that should not be the case. We need to either change the formatting preferences or change the checkstyle rules, because it doesn't make sense that the auto-format results in code that violates the checkstyle rules, like the example with enums that I listed.
Sure, it is not blocking, but it is a big pain for me, because we didn't agree to these rules at the beginning of the project and as a result, the style used by codegen and xtumlrt is very different than the one in tooling. I've been updating these, but it is taking me a long time, and in some cases it is quite problematic, and error prone. I mentioned the multi-return as an example because it requires refactoring code, and I already made a mistake with one such refactoring.
Also, take a look at what one of our files looks like in the editor:
It is a bit ridiculous. In fact, formatting oeprt.codegen.cpp.rts/UMLRTRuntime.java and the whole oeprt.codegen.lang plugins just strikes fear in me. I already reformatted UMLRTRuntime.java but it still has a gazillion warnings because of missing javadocs, and the reason is that that class has a lot of attributes. Which is one of the checkstyle rules that I don't like: very often it is obvious from the attribute name and type what it is.
Anyway, In order for me to work with the files that are not already formatted, I need to reformat, which includes adding all the javadocs, which takes quite a bit of time, so if I need to do anything before a file is formatted, I need to disable checkstyle for the project, and disable that format on save action as well, and then ignore the updated .project, and .prefs when pushing to gerrit, and that becomes a pain when switching branches.
I'm not saying that we should get rid of checkstyle or autoformat at this point, but I think we should revisit the rules and be a bit more flexible with some of them, and at the very least, make sure that the formatting preferences and the checkstyle rules are not mutually inconsistent.