Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aCxtX-0005HI-MB for pgsql-jdbc@arkaria.postgresql.org; Sat, 26 Dec 2015 23:05:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aCxtX-0007ub-5L for pgsql-jdbc@arkaria.postgresql.org; Sat, 26 Dec 2015 23:05:03 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aCxt1-0007MM-G8 for pgsql-jdbc@postgresql.org; Sat, 26 Dec 2015 23:04:31 +0000 Received: from smtprelay03.ispgateway.de ([80.67.29.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aCxsy-0005rL-0b for pgsql-jdbc@postgresql.org; Sat, 26 Dec 2015 23:04:30 +0000 Received: from [88.66.19.178] (helo=Zauselmaus) by smtprelay03.ispgateway.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.84) (envelope-from ) id 1aCxrW-0000yn-AQ for pgsql-jdbc@postgresql.org; Sun, 27 Dec 2015 00:02:58 +0100 From: "Markus KARG" To: "'List'" References: In-Reply-To: Subject: Re: PgJDBC: code reformat Date: Sun, 27 Dec 2015 00:04:25 +0100 Organization: Markus KARG, Staatl. gepr. Inf. Message-ID: <062c01d14031$c4f01aa0$4ed04fe0$@eu> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AdFAJivnlN7WNQIvTCCEJremzSV/DAACySNQ Content-Language: de X-AVK-Virus-Check: AVA 25.4584;60149F5 X-AVK-Spam-Check: 1; str=0001.0A0C0205.567F1CF8.0077,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0; F1206 X-Df-Sender: bWFya3VzQGhlYWRjcmFzaGluZy5ldQ== X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org -0 [X] I would rather go with Sun style instead of Google style; it is cont= ained in Eclipse as a selectable option, so I don't have to configure my ID= E at all but can rely on auto-format on saving a file. :-) -Markus -----Original Message----- From: pgsql-jdbc-owner@postgresql.org [mailto:pgsql-jdbc-owner@postgresql.o= rg] On Behalf Of Vladimir Sitnikov Sent: Samstag, 26. Dezember 2015 22:41 To: List Subject: [JDBC] PgJDBC: code reformat Hi, I would like to raise a discussion on coding guidelines. As discussed, single style is good. As there are no suggestions, I went ahead and tried "Google style, 100 char= acters per line". Here are some of the results: [1], [2], [3] I've spent ~3 hours to achieve = that, notable part of which was figuring out how to configure checkstyle. What works: 0) IDEA reformat gives checkstyle-compatible code 1) IDEA checkstyle plugin can show violations 2) mvn checkstyle:check 3) Travis Please vote: +1 [ ] The style is wonderful +0 [ ] It is good enough -0 [ ] Generally it is ok, but ... -1 [ ] I do not like it since ... Google style basically means: 1) K&R Egyptian brackets 2) Line break is inserted _before_ binary operators. For instance: "line 1" + "line 2" 3) Every variable should be declared on its own line. In other words, "int = a,b;" is forbidden 4) Certain variable & method naming conventions (<-- I have not yet looked = into this) My idea is to see how far IDEA can reformat the code to please checkstyle v= alidator. I've taken checkstyle configuration from their official sample (see [5]) and disabled certain checks (the ones that cannot be applied automatic= ally like variable naming conventions). There are still some checkstyle warnings (I think they should be converted = to errors): [4] [1] https://github.com/pgjdbc/pgjdbc/blob/format_code/pgjdbc/src/main/java/= org/postgresql/jdbc/PgStatement.java [2] https://github.com/pgjdbc/pgjdbc/blob/format_code/pgjdbc/src/main/java/= org/postgresql/jdbc/AbstractBlobClob.java [3] https://github.com/pgjdbc/pgjdbc/blob/format_code/pgjdbc/src/main/java/= org/postgresql/jdbc/PgDatabaseMetaData.java [4] https://travis-ci.org/pgjdbc/pgjdbc/jobs/98907638 [5] https://github.com/checkstyle/checkstyle/blob/master/src/main/resources= /google_checks.xml -- Regards, Vladimir Sitnikov --=20 Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc --=20 Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc