Hi,

I have configured the CheckStyle plugin and make a build with the default CheckStyle options:

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-checkstyle-plugin</artifactId>
    <version>2.17</version>
    <executions>
      <execution>
        <id>validate</id>
        <phase>validate</phase>
        <configuration>
          <encoding>UTF-8</encoding>
          <consoleOutput>true</consoleOutput>
          <failOnViolation>false</failOnViolation>
          <failsOnError>false</failsOnError>
          <linkXRef>false</linkXRef>
        </configuration>
        <goals>
          <goal>check</goal>
        </goals>
      </execution>
    </executions>
  </plugin>

Building with "mvn clean install -T4 -Dall -nsu -fn" without CheckStyle enabled the GeoTools build takes:
[INFO] Total time: 05:39 min (Wall Clock)

With the CheckStyle plugin enabled, one zillion style errors are reported and the plugin fails to execute in the following modules (didn't investigate why):

 * gt-coverage
 * gt-imagemosaic
 * gt-coverage-api
 * gt-render
 * gt-app-schema

The build time is:
[INFO] Total time: 13:53 min (Wall Clock)

Did we already investigate other options that allow us to do style checks (and other checks) only for a specific pull request (branch) changes ? In a quick search on Google I stepped on this: https://github.com/mmozuras/pronto

Regards,

Nuno Oliveira

On 02/11/2017 10:47 AM, Andrea Aime wrote:
Hi,
I'm reviving the code formatting dead horse (poor beast, beaten so many times) to see if we can improve and stop getting weekly complaints about the current state of code formatting

So I think everybody agrees that properly formatted code is nice and readable, however we have had a number of pushbacks against it in the years for a variety of reasons:

 1. Making it harder than necessary to review pull request
 2. Making it harder to check history about a certain line of code (a
    reformat makes it hard run "blame" on the code, one has to find
    the reformat and then run blame against the revision before it)
 3. Some coders trying to "table align" code and complaining against
    automatic reformats

My take on it:

 1. Pull request should not have reformats, period
 2. Periodic reformarts would make it just too hard to maintain code,
    but I would not mind too much a single giant "whole world" reformat
 3. I don't think we have anymore developers doing "sacred hand
    formatting" so not a problem I believe

I've seen that in QGIS a formatting violation breaks the build. They have it good because they are using the same tool (astyle) for both checking the formatting and to reformat the code, inside the build, IDE independent. In our case for as much as we try, I don't think that we can make all IDE agree exactly on the same formatting, so I would still ban wholesale file reformatting during normal development.

But we could maybe do a mass reformat on all active branches. There is a plugin here doing that based on a Eclipse config file (our coding conventions):
http://code.revelc.net/formatter-maven-plugin/formatter-maven-plugin/examples.html#Setting_Source_Files

We could do that, and be happy with the result... the formatting will then deteriorate over time again. Or we could add check for complaince... the plugin above seems to be supporting validation too (it might be a bit rigid and Eclipse specific though, need to try it out),
or we could use a CheckStyle check.
In both cases I'd be worried about the extra build time, and would like to verify if the overhead is acceptable or not.

Or we can just leave things as is and just pay attention to formatting of new code in pull requests.

Anyways... comments?

Cheers
Andrea





--
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


-------------------------------------------------------


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot


_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

--
==
GeoServer Professional Services from the experts!
Visit http://goo.gl/it488V for more information.
==
Nuno Miguel Carvalho Oliveira
@nmcoliveira
Software Engineer

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:   +39 0584 1660272
mob:   +39  333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i 
file/s allegato/i sono
da considerarsi strettamente riservate. Il loro utilizzo è consentito 
esclusivamente al destinatario del messaggio, per le finalità indicate
nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il 
destinatario, Vi preghiamo cortesemente di darcene notizia via e
-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal 
Vostro sistema. Conservare il messaggio stesso, divulgarlo
anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per 
finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely for the attention and use of
the named addressee(s) and may be confidential or proprietary in nature or 
covered by the provisions of privacy act (Legislative Decree
June, 30 2003, no.196 - Italy's New Data Protection Code).Any use not in accord 
with its purpose, any disclosure, reproduction, copying,
distribution, or either dissemination, either whole or partial, is strictly 
forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact immediately 
the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender does 
not give any warranty or accept liability as the content,
accuracy or completeness of sent messages and accepts no responsibility  for 
changes made after they were sent or for other risks which
arise as a result of e-mail transmission, viruses, etc.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to