You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geode.apache.org by Dale Emery <de...@pivotal.io> on 2018/05/25 00:14:08 UTC

PR: Configure Spotless not to join already-wrapped lines

Hi all,

I've submitted a PR to configure Spotless to refrain from joining already-wrapped lines:
https://github.com/apache/geode/pull/1994 <https://github.com/apache/geode/pull/1994>

My main motivation was to allow formatting method chains with one method per line (such as in long Stream pipelines, Mock configurations, and AssertJ assertions) when that would make the code easier to understand.

The change in my PR goes further than that. It causes Spotless not to join any lines if they are already shorter than the line length limit. I could not find an easy way to prevent joining lines only in method chains.

Comments?

Dale

—
Dale Emery
demery@pivotal.io


Re: PR: Configure Spotless not to join already-wrapped lines

Posted by Patrick Rhomberg <pr...@pivotal.io>.
I know that you and I aren't the only ones who disliked how spotless
disrupted method chains.

Since it won't recognize chain vs non-chain context, we as developers will
need to be more cognizant of this in general.  But I still think it's a
good tradeoff.

On Thu, May 24, 2018 at 5:14 PM, Dale Emery <de...@pivotal.io> wrote:

> Hi all,
>
> I've submitted a PR to configure Spotless to refrain from joining
> already-wrapped lines:
> https://github.com/apache/geode/pull/1994 <https://github.com/apache/
> geode/pull/1994>
>
> My main motivation was to allow formatting method chains with one method
> per line (such as in long Stream pipelines, Mock configurations, and
> AssertJ assertions) when that would make the code easier to understand.
>
> The change in my PR goes further than that. It causes Spotless not to join
> any lines if they are already shorter than the line length limit. I could
> not find an easy way to prevent joining lines only in method chains.
>
> Comments?
>
> Dale
>
> —
> Dale Emery
> demery@pivotal.io
>
>