OpenPDF icon indicating copy to clipboard operation
OpenPDF copied to clipboard

Code Convention and Style Guide

Open asturio opened this issue 6 years ago • 3 comments

OpenPDF had till 2019-10-12 no Coding Convention or Style guide. And the formatting of the code is really a mess.

So from now on, please use our Style Guide for Java code. This is a very short modification of the Google Guide for Java code: https://google.github.io/styleguide/javaguide.html

The differences are only: Indentation by 4 spaces, Continuation by 8 spaces. This way there should be not much reformatting in the project.

For IntelliJ: https://github.com/LibrePDF/OpenPDF/blob/master/intellij-java-openpdf-style.xml For Eclipse: Help wanted

asturio avatar Oct 12 '19 11:10 asturio

@asturio: what kind of help do you want on this issue? Creating the Eclipse settings file? Or more than that? Like running these settings on the master and submit a PR?

sixdouglas avatar Oct 13 '19 14:10 sixdouglas

@asturio: what kind of help do you want on this issue? Creating the Eclipse settings file? Or more than that? Like running these settings on the master and submit a PR?

An Eclipse file would be nice, the first step. Then we could add some more rules to checkstyle, but only one at time, so there will be no overwhelming warnings.

I think the curly braces rule and the indentation should be the first one, as these are the more significant rules, I think.

asturio avatar Oct 13 '19 16:10 asturio

Little Update:

I'm going to reformat all the code, to follow the convention, and turn on some checkstyles to catch any violations.

asturio avatar Mar 08 '24 19:03 asturio