Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [che-dev] Che developers formatting rules for Java

about #1, the only common tool across all IDE is maven
So I should say that we should have a maven plugin allowing to format the code (the same code convention could be used with Eclipse IDE, IntelliJ, Eclipse Che, another IDE) but at the end we could still use maven to check or format.

about #2, I would avoid any "developer's touch". Formatter is the rule. (we can complain on the format but once it is pick-up, it should be applied without exceptions)
because "he choice of the developer to make the code easier to read" is subjective. Some developers will like in one line, some on separate lines while the formatter will always be the same.


Florent

On Wed, Mar 29, 2017 at 10:51 AM, Sun Tan <sutan@xxxxxxxxxx> wrote:
I'd like to come up with some discussion we hard during reviews: https://github.com/eclipse/che/pull/4556/files/ba9e3984575c49f8f39a56db1df2e07b53786b3e#diff-ab312e4ea4cd0eee68fe53472bab93e1 

1. What tool to use to format code in Java ?
2. Usage of // to force Carriage return in some case

# 1. Some are using Intellij, the others Eclipse IDE and some others are using Eclipse Che as IDE.
For me, it makes sense to have a common formatter tool whatever the IDE we are using. It may also work from the command line and should be opensource. It should be possible to format part of the file. It should support Java files at least.
At the moment I use Che to code on Che so if someone has a formatter tool that meets all the previous requirements, I can take it ... otherwise if there isn't such a tool we should all use Che formatter to format our code :)

# 2. Usage of // to force Carriage return in some case
I had some questions about trailling // that I use to force cariage return when the formatter doesn't want to. The purpose is to avoid someone else that run a formatter to loose the carriage return that was there originally. I think this is the choice of the developer to make the code easier to read and to choose wether a line of code should be break into 2 line of code or not. Pretty much like when we add \ at the end of a bash script or Dockerfile.

--
Sun Tan
Senior Software Engineer
Eclipse Che @ Red Hat

_______________________________________________
che-dev mailing list
che-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/che-dev




--
Florent Benoit // Codenvy

Back to the top