Code Style Formatting

Bug #1497577 reported by Hamdi Roumani
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
storlets
New
Undecided
Unassigned

Bug Description

The python code in the repo is well formatted and conforms to pep8, the java code on the other hand is more inconsistent from file to file.

Consider proposing a formatting style precedence for java code for consistency.

For java there isn't an equivalent to pep8 per say, it's left up to the project but the following style checkers exist and seem somewhat popular:
https://github.com/checkstyle/checkstyle
http://jcsc.sourceforge.net/

Or maybe we just form our own ? Personally I only find a few things important:

1) Standard comment format for consistency
2) Predefined tab vs space (and # of spaces ... 3).
3) Line length
4) Complex IF block condition alignment (but this is a personal taste and something I picked up from my pervious job) e.g.
      if ( sqlpIsLogArchive1(hflag1)
          || ( dbcb->getLogState() == SQLP_OK
              && sqlpIsDatabaseConsistent(glfh)
              && ( !sqlpIsRecoveryLoggingNotOK(glfh)
                  || sqlpIsRecoverable(glfh))))

Really only 2) is important, namely for consistency, some folks use editors that highlight tabs ! Because many other standards don't like them : ) e.g. python.

Revision history for this message
Takashi Kajinami (kajinamit) wrote :

We already introduced linting about python, bash and ansible playbooks.

Remaining items are C codes and java codes

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.