[Geoserver-devel] Some experiments/thoughs on mass reformat

Hi,
I’ve been experimenting a bit with mass code base reformats approaches on GeoTools (used as a guinea
pig and hoping to transfer the same approach on GeoWebCache and Geoserver too, hence the
cross post).
I wrote a document to share my findings here (read only, but can be commented on), along with links
to branches where the reformatting happened:

https://docs.google.com/document/d/1_ub38YX2juf7uM8S8fywUTNzF5j9Zho-Jo5O_dXvI-Y/edit#

Originally I was thinking of approaching mass reformat in a code sprint, but since we have none planned,
a “lightweight” approach doing the smallest amount of work for the greatest benefit seems also
feasible.

Of the reformat approaches above, I cannot argue with the tooling and effectiveness of the Google style one,
but indenting only 2 spaces leaves me a bit “cold”, the code is flatter and structures seem harder to
locate… it may well be just a matter of habit.

The intellij command line one + checkstyle changes our approach to formatting less, but will
require more manual work on setting up checkstyle the way we want it, and seems to have more
overhead

So… would you like to see one of these actually committed and enforced?
Expressions of interest to help in this endeavor?

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.

Andrea,

the Google formatter looks like the strongest candidate, despite my sharing your lack of fondness for two-space indentation.

(1) Is it idempotent? That is, if you run the formatter a second time, does it change anything? There are some outstanding issues:
https://github.com/google/google-java-format/issues/254
https://github.com/google/google-java-format/issues/211

(2) Do we have a plan for Eclipse formatter:off and formatter:on tags? This is also discussed:
https://github.com/google/google-java-format/issues/137

Thanks for the interesting review of these tools. You had a fun weekend!

Kind regards,
Ben.

On 11/03/18 22:54, Andrea Aime wrote:

Hi,
I've been experimenting a bit with mass code base reformats approaches on
GeoTools (used as a guinea
pig and hoping to transfer the same approach on GeoWebCache and Geoserver
too, hence the
cross post).
I wrote a document to share my findings here (read only, but can be
commented on), along with links
to branches where the reformatting happened:

https://docs.google.com/document/d/1_ub38YX2juf7uM8S8fywUTNzF5j9Zho-Jo5O_dXvI-Y/edit#

Originally I was thinking of approaching mass reformat in a code sprint,
but since we have none planned,
a "lightweight" approach doing the smallest amount of work for the greatest
benefit seems also
feasible.

Of the reformat approaches above, I cannot argue with the tooling and
effectiveness of the Google style one,
but indenting only 2 spaces leaves me a bit "cold", the code is flatter and
structures seem harder to
locate... it may well be just a matter of habit.

The intellij command line one + checkstyle changes our approach to
formatting less, but will
require more manual work on setting up checkstyle the way we want it, and
seems to have more
overhead

So... would you like to see one of these actually committed and enforced?
Expressions of interest to help in this endeavor?

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

--
Ben Caradoc-Davies <ben@anonymised.com>
Director
Transient Software Limited <https://transient.nz/&gt;
New Zealand

The lack of customizability for the google formatter concerns me, especially once we start thinking about GeoServer (and I am also not a fan of enforced two-space indentation). I’ll also echo Ben’s comment about idempotency, that is a significant concern.

In particular, the Spring MVC Controllers in GeoServer have some nonstandard indentation that is included primarily for the sake of code clarity, e.g: https://github.com/geoserver/geoserver/blob/master/src/restconfig/src/main/java/org/geoserver/rest/catalog/LayerController.java#L136-L138

I believe there are other similar structures elsewhere that skirt the boundaries of our current rules for sake of readability (such as large boolean logic expressions, inline comments indented to be in line with applicable code, large concatenated string blocks indented to be more readable, and others), although I don’t have any specific examples at the moment.
A formatter which allows for customizability should be able to preserve this sort of stuff, but one that isn’t

I tried out the Intellij formatter on GeoServer on OS X, and a couple notes (branch):

  • It took 4 minutes to format all of GeoServer
  • Running the formatter a second time took 2.5 minutes, and altered 5 files, so not quite idempotent. A third time showed no changes, so it is likely that the initial formatting changes caused changes that required further formatting. Overall, not likely to be a serious issue.
  • I had to use slightly different command syntax - notably I needed the full path to the source directory, at the end of the command:

/bin/format.sh -r -m “*.java,pom.xml” -s <gs_source>/workspace/formatter.xml <gs_source>/geoserver/src

  • The Intellij formatter preserved the argline example in LayerController linked above as-is.

I also tried the fmt-maven-plugin on GeoServer (branch):

  • Since its part of the build, not quite sure how fast it was, but seemed pretty fast; full GeoServer build with reformatting (skipping tests) took 3 minutes (And I think maven downloaded a few jars .
  • Second pass of formatting changed 6 files. Third pass changed none, so the current version seems to be adequate with respect to idempotency.
  • Looking at some of the changes made, we get stuff like this:

String groupSearchFilter; //more appropriate name would be groupMembershipFilter - XStream backwards compatibility

becoming:

String
groupSearchFilter; // more appropriate name would be groupMembershipFilter - XStream backwards
// compatibility

Which seems to be pretty bad formatting. So that is a mark against the google formatter.

  • Formatting retained adequate legibility with respect to the argline example, by automatically moving the first argument to a newline, so that is promising:
@PutMapping(value = "/{layerName}")
public void layerPut(
    @RequestBody LayerInfo layer,
    @PathVariable String layerName,
    @PathVariable(required = false) String workspaceName) {

Overall, I think I prefer the Intellij formatter, due to customizability and four-space indentation.

Torben

···

On Sun, Mar 11, 2018 at 1:45 PM, Ben Caradoc-Davies <ben@anonymised.com> wrote:

Andrea,

the Google formatter looks like the strongest candidate, despite my sharing your lack of fondness for two-space indentation.

(1) Is it idempotent? That is, if you run the formatter a second time, does it change anything? There are some outstanding issues:
https://github.com/google/google-java-format/issues/254
https://github.com/google/google-java-format/issues/211

(2) Do we have a plan for Eclipse formatter:off and formatter:on tags? This is also discussed:
https://github.com/google/google-java-format/issues/137

Thanks for the interesting review of these tools. You had a fun weekend!

Kind regards,
Ben.

On 11/03/18 22:54, Andrea Aime wrote:

Hi,
I’ve been experimenting a bit with mass code base reformats approaches on
GeoTools (used as a guinea
pig and hoping to transfer the same approach on GeoWebCache and Geoserver
too, hence the
cross post).
I wrote a document to share my findings here (read only, but can be
commented on), along with links
to branches where the reformatting happened:

https://docs.google.com/document/d/1_ub38YX2juf7uM8S8fywUTNzF5j9Zho-Jo5O_dXvI-Y/edit#

Originally I was thinking of approaching mass reformat in a code sprint,
but since we have none planned,
a “lightweight” approach doing the smallest amount of work for the greatest
benefit seems also
feasible.

Of the reformat approaches above, I cannot argue with the tooling and
effectiveness of the Google style one,
but indenting only 2 spaces leaves me a bit “cold”, the code is flatter and
structures seem harder to
locate… it may well be just a matter of habit.

The intellij command line one + checkstyle changes our approach to
formatting less, but will
require more manual work on setting up checkstyle the way we want it, and
seems to have more
overhead

So… would you like to see one of these actually committed and enforced?
Expressions of interest to help in this endeavor?

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@anonymised.comge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Ben Caradoc-Davies <ben@anonymised.com>
Director
Transient Software Limited <https://transient.nz/>
New Zealand


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


Geoserver-devel mailing list
Geoserver-devel@anonymised.comrge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

On 13/03/18 13:01, Torben Barsballe wrote:

large concatenated string blocks indented to be more readable

Especially XML documents included in code, such as those used in test fixtures. My workaround before I started using @formatter:off was trailing // comments to defeat the Eclipse formatter.

    - Looking at some of the changes made, we get stuff like this:
     String groupSearchFilter; //more appropriate name would be
groupMembershipFilter - XStream backwards compatibility
becoming:
      String
          groupSearchFilter; // more appropriate name would be
    groupMembershipFilter - XStream backwards
      // compatibility
    Which seems to be pretty bad formatting. So that is a mark against the
    google formatter.

Yes, that is terrible.

Kind regards,

--
Ben Caradoc-Davies <ben@anonymised.com>
Director
Transient Software Limited <https://transient.nz/&gt;
New Zealand

Ok,
so far it seems that there is a preference for the intellij approach.
Mind, in that case idempotence is not as important because we’d be doing the formatting only once (it’s a manual process
not integrated in the build), and then rely on checkstyle for verifying violations.

This is also the path requiring the most work, checkstyle seems to be mostly about best practice and less about formatting,
so not sure how much we can actually automate in terms of keeping the formatting pristine, but at least some checks we
can use, like not using tabs and having proper indentation.

We’ll have to spend some time figuring out a suitable configuration and then see if we want to add extras on top of it
(e.g. constants all uppercase and the like) which likely will require manual intervention on the code to actually pass.

Is it something that we can organize and share effort on?

Cheers
Andrea

···

On Tue, Mar 13, 2018 at 2:21 AM, Ben Caradoc-Davies <ben@anonymised.com> wrote:

On 13/03/18 13:01, Torben Barsballe wrote:

large concatenated string blocks indented to be more readable

Especially XML documents included in code, such as those used in test fixtures. My workaround before I started using @formatter:off was trailing // comments to defeat the Eclipse formatter.

  • Looking at some of the changes made, we get stuff like this:
    String groupSearchFilter; //more appropriate name would be
    groupMembershipFilter - XStream backwards compatibility
    becoming:
    String
    groupSearchFilter; // more appropriate name would be
    groupMembershipFilter - XStream backwards
    // compatibility
    Which seems to be pretty bad formatting. So that is a mark against the
    google formatter.

Yes, that is terrible.

Kind regards,


Ben Caradoc-Davies <ben@anonymised.com>
Director
Transient Software Limited <https://transient.nz/>
New Zealand

Regards,

Andrea Aime

==
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.

Thanks for moving this along Andrea, now is a good time as we reach the end of the code freeze

To that end here is a proposal page for your preferred option: https://github.com/geotools/geotools/wiki/GeoTools-Codebase-Reformat

···

On 14 March 2018 at 02:33, Andrea Aime <andrea.aime@anonymised.com> wrote:

Ok,
so far it seems that there is a preference for the intellij approach.
Mind, in that case idempotence is not as important because we’d be doing the formatting only once (it’s a manual process
not integrated in the build), and then rely on checkstyle for verifying violations.

This is also the path requiring the most work, checkstyle seems to be mostly about best practice and less about formatting,
so not sure how much we can actually automate in terms of keeping the formatting pristine, but at least some checks we
can use, like not using tabs and having proper indentation.

We’ll have to spend some time figuring out a suitable configuration and then see if we want to add extras on top of it
(e.g. constants all uppercase and the like) which likely will require manual intervention on the code to actually pass.

Is it something that we can organize and share effort on?

Cheers
Andrea


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@anonymised.com66…sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Jody Garnett

On Tue, Mar 13, 2018 at 2:21 AM, Ben Caradoc-Davies <ben@anonymised.com> wrote:

On 13/03/18 13:01, Torben Barsballe wrote:

large concatenated string blocks indented to be more readable

Especially XML documents included in code, such as those used in test fixtures. My workaround before I started using @formatter:off was trailing // comments to defeat the Eclipse formatter.

  • Looking at some of the changes made, we get stuff like this:
    String groupSearchFilter; //more appropriate name would be
    groupMembershipFilter - XStream backwards compatibility
    becoming:
    String
    groupSearchFilter; // more appropriate name would be
    groupMembershipFilter - XStream backwards
    // compatibility
    Which seems to be pretty bad formatting. So that is a mark against the
    google formatter.

Yes, that is terrible.

Kind regards,


Ben Caradoc-Davies <ben@anonymised.com>
Director
Transient Software Limited <https://transient.nz/>
New Zealand

Regards,

Andrea Aime

==
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.

Hi Jody,
thanks for getting the proposal started.
This is something I’m doing solely in my spare time, so resourcing is a problem. I’ll see what I can do, not sure I can do it alone.
I started this thread also to gauge interest in helping getting it done.

Cheers
Andrea

···

On Thu, Mar 15, 2018 at 12:17 AM, Jody Garnett <jody.garnett@anonymised.com> wrote:

Thanks for moving this along Andrea, now is a good time as we reach the end of the code freeze

To that end here is a proposal page for your preferred option: https://github.com/geotools/geotools/wiki/GeoTools-Codebase-Reformat


Jody Garnett

On 14 March 2018 at 02:33, Andrea Aime <andrea.aime@anonymised.com> wrote:

Ok,
so far it seems that there is a preference for the intellij approach.
Mind, in that case idempotence is not as important because we’d be doing the formatting only once (it’s a manual process
not integrated in the build), and then rely on checkstyle for verifying violations.

This is also the path requiring the most work, checkstyle seems to be mostly about best practice and less about formatting,
so not sure how much we can actually automate in terms of keeping the formatting pristine, but at least some checks we
can use, like not using tabs and having proper indentation.

We’ll have to spend some time figuring out a suitable configuration and then see if we want to add extras on top of it
(e.g. constants all uppercase and the like) which likely will require manual intervention on the code to actually pass.

Is it something that we can organize and share effort on?

Cheers
Andrea


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@anonymised.comge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

On Tue, Mar 13, 2018 at 2:21 AM, Ben Caradoc-Davies <ben@anonymised.com> wrote:

On 13/03/18 13:01, Torben Barsballe wrote:

large concatenated string blocks indented to be more readable

Especially XML documents included in code, such as those used in test fixtures. My workaround before I started using @formatter:off was trailing // comments to defeat the Eclipse formatter.

  • Looking at some of the changes made, we get stuff like this:
    String groupSearchFilter; //more appropriate name would be
    groupMembershipFilter - XStream backwards compatibility
    becoming:
    String
    groupSearchFilter; // more appropriate name would be
    groupMembershipFilter - XStream backwards
    // compatibility
    Which seems to be pretty bad formatting. So that is a mark against the
    google formatter.

Yes, that is terrible.

Kind regards,


Ben Caradoc-Davies <ben@anonymised.com>
Director
Transient Software Limited <https://transient.nz/>
New Zealand

Regards,

Andrea Aime

==
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.

Regards,

Andrea Aime

==
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.

Understood, indeed why I made the page. Let’s use the tasks section to line up volunteers before voting.

If the process is solid it may be suitable for code sprint. Assume reformatting won’t violate our code freeze.

···

On Thu, Mar 15, 2018 at 12:17 AM, Jody Garnett <jody.garnett@anonymised.com…> wrote:

Thanks for moving this along Andrea, now is a good time as we reach the end of the code freeze

To that end here is a proposal page for your preferred option: https://github.com/geotools/geotools/wiki/GeoTools-Codebase-Reformat

Regards,

Andrea Aime

==
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.


Jody Garnett

On 14 March 2018 at 02:33, Andrea Aime <andrea.aime@anonymised.com> wrote:

Ok,
so far it seems that there is a preference for the intellij approach.
Mind, in that case idempotence is not as important because we’d be doing the formatting only once (it’s a manual process
not integrated in the build), and then rely on checkstyle for verifying violations.

This is also the path requiring the most work, checkstyle seems to be mostly about best practice and less about formatting,
so not sure how much we can actually automate in terms of keeping the formatting pristine, but at least some checks we
can use, like not using tabs and having proper indentation.

We’ll have to spend some time figuring out a suitable configuration and then see if we want to add extras on top of it
(e.g. constants all uppercase and the like) which likely will require manual intervention on the code to actually pass.

Is it something that we can organize and share effort on?

Cheers
Andrea


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

On Tue, Mar 13, 2018 at 2:21 AM, Ben Caradoc-Davies <ben@anonymised.com1…> wrote:

On 13/03/18 13:01, Torben Barsballe wrote:

large concatenated string blocks indented to be more readable

Especially XML documents included in code, such as those used in test fixtures. My workaround before I started using @formatter:off was trailing // comments to defeat the Eclipse formatter.

  • Looking at some of the changes made, we get stuff like this:
    String groupSearchFilter; //more appropriate name would be
    groupMembershipFilter - XStream backwards compatibility
    becoming:
    String
    groupSearchFilter; // more appropriate name would be
    groupMembershipFilter - XStream backwards
    // compatibility
    Which seems to be pretty bad formatting. So that is a mark against the
    google formatter.

Yes, that is terrible.

Kind regards,


Ben Caradoc-Davies <ben@anonymised.com>
Director
Transient Software Limited <https://transient.nz/>
New Zealand

Regards,

Andrea Aime

==
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.


Jody Garnett

Hi Andrea,

I’ll be able to provide some assistance.

One comment on the proposal - checkstyle should be in place when we merge the formatting changes to master; would be an good first test.

Torben

···

On Thu, Mar 15, 2018 at 9:19 AM, Jody Garnett <jody.garnett@anonymised.com> wrote:

Understood, indeed why I made the page. Let’s use the tasks section to line up volunteers before voting.

If the process is solid it may be suitable for code sprint. Assume reformatting won’t violate our code freeze.

On Thu, Mar 15, 2018 at 2:43 AM Andrea Aime <andrea.aime@anonymised.com> wrote:

Hi Jody,
thanks for getting the proposal started.
This is something I’m doing solely in my spare time, so resourcing is a problem. I’ll see what I can do, not sure I can do it alone.
I started this thread also to gauge interest in helping getting it done.

Cheers

Andrea


Jody Garnett


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


Geoserver-devel mailing list
Geoserver-devel@anonymised.com.366…sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

On Thu, Mar 15, 2018 at 12:17 AM, Jody Garnett <jody.garnett@anonymised.com> wrote:

Thanks for moving this along Andrea, now is a good time as we reach the end of the code freeze

To that end here is a proposal page for your preferred option: https://github.com/geotools/geotools/wiki/GeoTools-Codebase-Reformat

Regards,

Andrea Aime

==
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.


Jody Garnett

On 14 March 2018 at 02:33, Andrea Aime <andrea.aime@anonymised.com> wrote:

Ok,
so far it seems that there is a preference for the intellij approach.
Mind, in that case idempotence is not as important because we’d be doing the formatting only once (it’s a manual process
not integrated in the build), and then rely on checkstyle for verifying violations.

This is also the path requiring the most work, checkstyle seems to be mostly about best practice and less about formatting,
so not sure how much we can actually automate in terms of keeping the formatting pristine, but at least some checks we
can use, like not using tabs and having proper indentation.

We’ll have to spend some time figuring out a suitable configuration and then see if we want to add extras on top of it
(e.g. constants all uppercase and the like) which likely will require manual intervention on the code to actually pass.

Is it something that we can organize and share effort on?

Cheers
Andrea


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@anonymised.comsourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

On Tue, Mar 13, 2018 at 2:21 AM, Ben Caradoc-Davies <ben@anonymised.com> wrote:

On 13/03/18 13:01, Torben Barsballe wrote:

large concatenated string blocks indented to be more readable

Especially XML documents included in code, such as those used in test fixtures. My workaround before I started using @formatter:off was trailing // comments to defeat the Eclipse formatter.

  • Looking at some of the changes made, we get stuff like this:
    String groupSearchFilter; //more appropriate name would be
    groupMembershipFilter - XStream backwards compatibility
    becoming:
    String
    groupSearchFilter; // more appropriate name would be
    groupMembershipFilter - XStream backwards
    // compatibility
    Which seems to be pretty bad formatting. So that is a mark against the
    google formatter.

Yes, that is terrible.

Kind regards,


Ben Caradoc-Davies <ben@anonymised.com>
Director
Transient Software Limited <https://transient.nz/>
New Zealand

Regards,

Andrea Aime

==
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.

On Thu, Mar 15, 2018 at 6:10 PM, Torben Barsballe <
tbarsballe@anonymised.com> wrote:

Hi Andrea,

I'll be able to provide some assistance.

One comment on the proposal - checkstyle should be in place when we merge
the formatting changes to master; would be an good first test.

Yep. Indeed the manual work needed for this approach is (I believe).

   - Close as many pull requests as possible (big conflict wave
   approaching!)
   - Figure a suitable checkstyle setup, the out of the box ones do much
   more than we want (we can add extras later)
   - Quickly do pull requests for all branches, one project at a time

And of course, I'd like to hear from the other community members about this
too, since everybody is going to be affected :slight_smile:

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.