trafodion-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Selva Govindarajan <selva.govindara...@esgyn.com>
Subject RE: Standardize on java code style
Date Thu, 07 Jun 2018 16:53:19 GMT
Are there any other guidelines for contributors who use neither of these IDE or any IDE at
all?  In my opinion, 8 spaces seem to be a large indentation that would take the code away
from the screen.  Can these plug-ins be configured with smaller number of spaces.

Selva

-----Original Message-----
From: Hans Zeller <hans.zeller@esgyn.com> 
Sent: Thursday, June 7, 2018 9:29 AM
To: dev@trafodion.apache.org
Subject: RE: Standardize on java code style

+1 on Venkat's proposal.

The Google style seems reasonably compatible with what we have already, both in Java and in
C++.

Here are a few guidelines that should help avoiding such large differences, whether we adopt
the Google style or not:

- Don't format entire files, especially not if there is not a common agreed upon style
- Don't insert any tabs into source files (part of Google style)
- For those tabs that unfortunately are in the code, use 8 spaces as the width, as most simple
tools (vi, github.com, emacs, Notepad, BeyondCompare, etc.) do

To Avinash's question: Yes, these are Maven projects.

Thanks,

Hans

-----Original Message-----
From: Avinash Dongre <avinash@ampool.io> 
Sent: Wednesday, June 6, 2018 10:38 PM
To: dev@trafodion.apache.org
Subject: Re: Standardize on java code style

I have not seen the java code, is it maven based project ??


If java project is converted into gradle, then it has spotless plugin which while building
the code fixes the code style.



Thanks

Avinash


________________________________
From: Venkat Muthuswamy <venkat.muthuswamy@esgyn.com>
Sent: 04 June 2018 23:56:21
To: dev@trafodion.apache.org
Subject: Standardize on java code style

Hi,

Given that many contributors are touching same java files and using their own editors of choice,
it becomes difficult to review PRs when git reports large change when mismatch in tabs vs
spaces.

Can we standardize on the java code style using the google java code style? There are plugins
for eclipse and IntelliJ IDEs.
We start using these on any new files we touch going forward.

https://github.com/google/google-java-format
GitHub - google/google-java-format: Reformats Java source ...<https://github.com/google/google-java-format>
github.com
README.md google-java-format. google-java-format is a program that reformats Java source code
to comply with Google Java Style.. Using the formatter from the command-line ...



https://google.github.io/styleguide/javaguide.html

For eclipse, You can download the plugin jar and copy it to your eclipse/drop-ins folder.
Restart eclipse and then set your java formatter implementation to google-java-format in Window
> Preferences > Java > Code Style > Formatter > Formatter Implementation

Comments ?

Venkat

Mime
View raw message