You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@asterixdb.apache.org by Michael Blow <mb...@gmail.com> on 2018/01/28 21:01:37 UTC

PLEASE READ: Automatic formatting of sources

All,

As mentioned in last week's status meeting, I have submitted a change which
applies and enforces our code format[1] at build / jenkins time.  As of
this commit, source formatting happens as part of the 'process-sources'
build phase.  This can be run explicitly (to format your code prior to
commit) but is already run prior to the compile phase, so if you are
building with maven, it will be run for you.

Jenkins will be enforcing that patches moving forward comply with the
template [2].  If your patch fails this job, ensure you run 'mvn
process-sources' and resubmit the result.

To migrate outstanding topic branches, it is recommended to do the
following steps to minimize conflict resolution:

*ade merge cb9ca97531eddee2cd312654bf13b0905cb3ef6e~1 *
*mvn process-sources -Psource-format -Drat.skip*
*ade commit -a*
*ade merge cb9ca97531eddee2cd312654bf13b0905cb3ef6e*
*ade commit -a*

Let me know if you run into any issues,

Thanks,

-MDB

[1] -
https://cwiki.apache.org/confluence/download/attachments/61322291/AsterixCodeFormatProfile.xml
[2] - https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-source-format/

Re: PLEASE READ: Automatic formatting of sources

Posted by Michael Blow <mb...@gmail.com>.
s/ade/git/ in those commands- I suffered a case of Oracle flashback when
writing those out...
On Sun, Jan 28, 2018 at 10:20 PM Michael Blow <mb...@gmail.com>
wrote:

> Hi Steven,
>
> Technically all lines will be processed, however this is effectively only
> edited lines since we have a normalized baseline.
>
> On Sun, Jan 28, 2018 at 6:01 PM Steven Jacobs <sj...@ucr.edu> wrote:
>
>> Just curious, is it going to format everything (as in, your change cleaned
>> up the entire code base) or just the edited lines only?
>> Steven
>>
>> On Sun, Jan 28, 2018 at 1:01 PM Michael Blow <mb...@gmail.com>
>> wrote:
>>
>> > All,
>> >
>> > As mentioned in last week's status meeting, I have submitted a change
>> which
>> > applies and enforces our code format[1] at build / jenkins time.  As of
>> > this commit, source formatting happens as part of the 'process-sources'
>> > build phase.  This can be run explicitly (to format your code prior to
>> > commit) but is already run prior to the compile phase, so if you are
>> > building with maven, it will be run for you.
>> >
>> > Jenkins will be enforcing that patches moving forward comply with the
>> > template [2].  If your patch fails this job, ensure you run 'mvn
>> > process-sources' and resubmit the result.
>> >
>> > To migrate outstanding topic branches, it is recommended to do the
>> > following steps to minimize conflict resolution:
>> >
>> > *ade merge cb9ca97531eddee2cd312654bf13b0905cb3ef6e~1 *
>> > *mvn process-sources -Psource-format -Drat.skip*
>> > *ade commit -a*
>> > *ade merge cb9ca97531eddee2cd312654bf13b0905cb3ef6e*
>> > *ade commit -a*
>> >
>> > Let me know if you run into any issues,
>> >
>> > Thanks,
>> >
>> > -MDB
>> >
>> > [1] -
>> >
>> >
>> https://cwiki.apache.org/confluence/download/attachments/61322291/AsterixCodeFormatProfile.xml
>> > [2] -
>> > https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-source-format/
>> >
>>
>

Re: PLEASE READ: Automatic formatting of sources

Posted by Michael Blow <mb...@gmail.com>.
Hi Steven,

Technically all lines will be processed, however this is effectively only
edited lines since we have a normalized baseline.

On Sun, Jan 28, 2018 at 6:01 PM Steven Jacobs <sj...@ucr.edu> wrote:

> Just curious, is it going to format everything (as in, your change cleaned
> up the entire code base) or just the edited lines only?
> Steven
>
> On Sun, Jan 28, 2018 at 1:01 PM Michael Blow <mb...@gmail.com>
> wrote:
>
> > All,
> >
> > As mentioned in last week's status meeting, I have submitted a change
> which
> > applies and enforces our code format[1] at build / jenkins time.  As of
> > this commit, source formatting happens as part of the 'process-sources'
> > build phase.  This can be run explicitly (to format your code prior to
> > commit) but is already run prior to the compile phase, so if you are
> > building with maven, it will be run for you.
> >
> > Jenkins will be enforcing that patches moving forward comply with the
> > template [2].  If your patch fails this job, ensure you run 'mvn
> > process-sources' and resubmit the result.
> >
> > To migrate outstanding topic branches, it is recommended to do the
> > following steps to minimize conflict resolution:
> >
> > *ade merge cb9ca97531eddee2cd312654bf13b0905cb3ef6e~1 *
> > *mvn process-sources -Psource-format -Drat.skip*
> > *ade commit -a*
> > *ade merge cb9ca97531eddee2cd312654bf13b0905cb3ef6e*
> > *ade commit -a*
> >
> > Let me know if you run into any issues,
> >
> > Thanks,
> >
> > -MDB
> >
> > [1] -
> >
> >
> https://cwiki.apache.org/confluence/download/attachments/61322291/AsterixCodeFormatProfile.xml
> > [2] -
> > https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-source-format/
> >
>

Re: PLEASE READ: Automatic formatting of sources

Posted by Ted Dunning <te...@gmail.com>.
Sure. And it is your project.

The only value in my comments was the view from outside.

The fact that this is only for untouched does changes the matter
substantially

On Jan 29, 2018 7:04 PM, "Till Westmann" <ti...@apache.org> wrote:

> Hi Ted,
>
> just to follow up on this. We’ve been using a shared code format for a few
> years, so most of the code is formatted consistently. And we’ve also had a
> style checker for a while that checked the changed code against the style.
>
> However, one problem that we’ve still seen repeatedly is that different
> versions of tools (Eclipse, IDEA, the formatting plugin) - using the same
> input file - disagree on the way to break long lines. So we often had
> changes from one style of line breaks to another one and back which made
> diffs busier than necessary.
>
> This current change should fix that and it only affects
> - line breaks and
> - files that haven’t been touched since we introduced the format tests.
>
> So the amount (and complexity) of merge conflicts shouldn’t be too bad.
>
> Till
>
> On 29 Jan 2018, at 7:28, Michael Blow wrote:
>
> > Indeed it is a brute-force solution to the problem; while we pay a one
> time
> > cost to baseline the codebase as formatted, this eliminates the constant
> > extraneous (formatting) diffs when reviewing patches on gerrit as we make
> > incremental (and often reverse) progress.  To ensure we don't deviate
> from
> > the format, we have a Jenkins test which will block the patch in case of
> > noncompliant code.
> >
> > On Sun, Jan 28, 2018 at 8:42 PM Ted Dunning <te...@gmail.com>
> wrote:
> >
> >> I am an outsider, but this seems really heavy handed.
> >>
> >> Perhaps better would be a style checker that prevents tests from
> passing.
> >> That would allow a human to judge a bit of the best way to meet the
> >> requirements.
> >>
> >> Potentially large automated reformats can really be painful to merging.
> >>
> >> On Jan 28, 2018 3:01 PM, "Steven Jacobs" <sj...@ucr.edu> wrote:
> >>
> >>> Just curious, is it going to format everything (as in, your change
> >> cleaned
> >>> up the entire code base) or just the edited lines only?
> >>> Steven
> >>>
> >>> On Sun, Jan 28, 2018 at 1:01 PM Michael Blow <mb...@gmail.com>
> >>> wrote:
> >>>
> >>>> All,
> >>>>
> >>>> As mentioned in last week's status meeting, I have submitted a change
> >>> which
> >>>> applies and enforces our code format[1] at build / jenkins time.  As
> of
> >>>> this commit, source formatting happens as part of the
> 'process-sources'
> >>>> build phase.  This can be run explicitly (to format your code prior to
> >>>> commit) but is already run prior to the compile phase, so if you are
> >>>> building with maven, it will be run for you.
> >>>>
> >>>> Jenkins will be enforcing that patches moving forward comply with the
> >>>> template [2].  If your patch fails this job, ensure you run 'mvn
> >>>> process-sources' and resubmit the result.
> >>>>
> >>>> To migrate outstanding topic branches, it is recommended to do the
> >>>> following steps to minimize conflict resolution:
> >>>>
> >>>> *ade merge cb9ca97531eddee2cd312654bf13b0905cb3ef6e~1 *
> >>>> *mvn process-sources -Psource-format -Drat.skip*
> >>>> *ade commit -a*
> >>>> *ade merge cb9ca97531eddee2cd312654bf13b0905cb3ef6e*
> >>>> *ade commit -a*
> >>>>
> >>>> Let me know if you run into any issues,
> >>>>
> >>>> Thanks,
> >>>>
> >>>> -MDB
> >>>>
> >>>> [1] -
> >>>>
> >>>> https://cwiki.apache.org/confluence/download/attachments/61322291/
> >>> AsterixCodeFormatProfile.xml
> >>>> [2] -
> >>>> https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-source-format/
> >>>>
> >>>
> >>
>

Re: PLEASE READ: Automatic formatting of sources

Posted by Till Westmann <ti...@apache.org>.
Hi Ted,

just to follow up on this. We’ve been using a shared code format for a few
years, so most of the code is formatted consistently. And we’ve also had a
style checker for a while that checked the changed code against the style.

However, one problem that we’ve still seen repeatedly is that different
versions of tools (Eclipse, IDEA, the formatting plugin) - using the same
input file - disagree on the way to break long lines. So we often had
changes from one style of line breaks to another one and back which made
diffs busier than necessary.

This current change should fix that and it only affects
- line breaks and
- files that haven’t been touched since we introduced the format tests.

So the amount (and complexity) of merge conflicts shouldn’t be too bad.

Till

On 29 Jan 2018, at 7:28, Michael Blow wrote:

> Indeed it is a brute-force solution to the problem; while we pay a one time
> cost to baseline the codebase as formatted, this eliminates the constant
> extraneous (formatting) diffs when reviewing patches on gerrit as we make
> incremental (and often reverse) progress.  To ensure we don't deviate from
> the format, we have a Jenkins test which will block the patch in case of
> noncompliant code.
>
> On Sun, Jan 28, 2018 at 8:42 PM Ted Dunning <te...@gmail.com> wrote:
>
>> I am an outsider, but this seems really heavy handed.
>>
>> Perhaps better would be a style checker that prevents tests from passing.
>> That would allow a human to judge a bit of the best way to meet the
>> requirements.
>>
>> Potentially large automated reformats can really be painful to merging.
>>
>> On Jan 28, 2018 3:01 PM, "Steven Jacobs" <sj...@ucr.edu> wrote:
>>
>>> Just curious, is it going to format everything (as in, your change
>> cleaned
>>> up the entire code base) or just the edited lines only?
>>> Steven
>>>
>>> On Sun, Jan 28, 2018 at 1:01 PM Michael Blow <mb...@gmail.com>
>>> wrote:
>>>
>>>> All,
>>>>
>>>> As mentioned in last week's status meeting, I have submitted a change
>>> which
>>>> applies and enforces our code format[1] at build / jenkins time.  As of
>>>> this commit, source formatting happens as part of the 'process-sources'
>>>> build phase.  This can be run explicitly (to format your code prior to
>>>> commit) but is already run prior to the compile phase, so if you are
>>>> building with maven, it will be run for you.
>>>>
>>>> Jenkins will be enforcing that patches moving forward comply with the
>>>> template [2].  If your patch fails this job, ensure you run 'mvn
>>>> process-sources' and resubmit the result.
>>>>
>>>> To migrate outstanding topic branches, it is recommended to do the
>>>> following steps to minimize conflict resolution:
>>>>
>>>> *ade merge cb9ca97531eddee2cd312654bf13b0905cb3ef6e~1 *
>>>> *mvn process-sources -Psource-format -Drat.skip*
>>>> *ade commit -a*
>>>> *ade merge cb9ca97531eddee2cd312654bf13b0905cb3ef6e*
>>>> *ade commit -a*
>>>>
>>>> Let me know if you run into any issues,
>>>>
>>>> Thanks,
>>>>
>>>> -MDB
>>>>
>>>> [1] -
>>>>
>>>> https://cwiki.apache.org/confluence/download/attachments/61322291/
>>> AsterixCodeFormatProfile.xml
>>>> [2] -
>>>> https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-source-format/
>>>>
>>>
>>

Re: PLEASE READ: Automatic formatting of sources

Posted by Michael Blow <mb...@gmail.com>.
Indeed it is a brute-force solution to the problem; while we pay a one time
cost to baseline the codebase as formatted, this eliminates the constant
extraneous (formatting) diffs when reviewing patches on gerrit as we make
incremental (and often reverse) progress.  To ensure we don't deviate from
the format, we have a Jenkins test which will block the patch in case of
noncompliant code.

On Sun, Jan 28, 2018 at 8:42 PM Ted Dunning <te...@gmail.com> wrote:

> I am an outsider, but this seems really heavy handed.
>
> Perhaps better would be a style checker that prevents tests from passing.
> That would allow a human to judge a bit of the best way to meet the
> requirements.
>
> Potentially large automated reformats can really be painful to merging.
>
> On Jan 28, 2018 3:01 PM, "Steven Jacobs" <sj...@ucr.edu> wrote:
>
> > Just curious, is it going to format everything (as in, your change
> cleaned
> > up the entire code base) or just the edited lines only?
> > Steven
> >
> > On Sun, Jan 28, 2018 at 1:01 PM Michael Blow <mb...@gmail.com>
> > wrote:
> >
> > > All,
> > >
> > > As mentioned in last week's status meeting, I have submitted a change
> > which
> > > applies and enforces our code format[1] at build / jenkins time.  As of
> > > this commit, source formatting happens as part of the 'process-sources'
> > > build phase.  This can be run explicitly (to format your code prior to
> > > commit) but is already run prior to the compile phase, so if you are
> > > building with maven, it will be run for you.
> > >
> > > Jenkins will be enforcing that patches moving forward comply with the
> > > template [2].  If your patch fails this job, ensure you run 'mvn
> > > process-sources' and resubmit the result.
> > >
> > > To migrate outstanding topic branches, it is recommended to do the
> > > following steps to minimize conflict resolution:
> > >
> > > *ade merge cb9ca97531eddee2cd312654bf13b0905cb3ef6e~1 *
> > > *mvn process-sources -Psource-format -Drat.skip*
> > > *ade commit -a*
> > > *ade merge cb9ca97531eddee2cd312654bf13b0905cb3ef6e*
> > > *ade commit -a*
> > >
> > > Let me know if you run into any issues,
> > >
> > > Thanks,
> > >
> > > -MDB
> > >
> > > [1] -
> > >
> > > https://cwiki.apache.org/confluence/download/attachments/61322291/
> > AsterixCodeFormatProfile.xml
> > > [2] -
> > > https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-source-format/
> > >
> >
>

Re: PLEASE READ: Automatic formatting of sources

Posted by Ted Dunning <te...@gmail.com>.
I am an outsider, but this seems really heavy handed.

Perhaps better would be a style checker that prevents tests from passing.
That would allow a human to judge a bit of the best way to meet the
requirements.

Potentially large automated reformats can really be painful to merging.

On Jan 28, 2018 3:01 PM, "Steven Jacobs" <sj...@ucr.edu> wrote:

> Just curious, is it going to format everything (as in, your change cleaned
> up the entire code base) or just the edited lines only?
> Steven
>
> On Sun, Jan 28, 2018 at 1:01 PM Michael Blow <mb...@gmail.com>
> wrote:
>
> > All,
> >
> > As mentioned in last week's status meeting, I have submitted a change
> which
> > applies and enforces our code format[1] at build / jenkins time.  As of
> > this commit, source formatting happens as part of the 'process-sources'
> > build phase.  This can be run explicitly (to format your code prior to
> > commit) but is already run prior to the compile phase, so if you are
> > building with maven, it will be run for you.
> >
> > Jenkins will be enforcing that patches moving forward comply with the
> > template [2].  If your patch fails this job, ensure you run 'mvn
> > process-sources' and resubmit the result.
> >
> > To migrate outstanding topic branches, it is recommended to do the
> > following steps to minimize conflict resolution:
> >
> > *ade merge cb9ca97531eddee2cd312654bf13b0905cb3ef6e~1 *
> > *mvn process-sources -Psource-format -Drat.skip*
> > *ade commit -a*
> > *ade merge cb9ca97531eddee2cd312654bf13b0905cb3ef6e*
> > *ade commit -a*
> >
> > Let me know if you run into any issues,
> >
> > Thanks,
> >
> > -MDB
> >
> > [1] -
> >
> > https://cwiki.apache.org/confluence/download/attachments/61322291/
> AsterixCodeFormatProfile.xml
> > [2] -
> > https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-source-format/
> >
>

Re: PLEASE READ: Automatic formatting of sources

Posted by Steven Jacobs <sj...@ucr.edu>.
Just curious, is it going to format everything (as in, your change cleaned
up the entire code base) or just the edited lines only?
Steven

On Sun, Jan 28, 2018 at 1:01 PM Michael Blow <mb...@gmail.com> wrote:

> All,
>
> As mentioned in last week's status meeting, I have submitted a change which
> applies and enforces our code format[1] at build / jenkins time.  As of
> this commit, source formatting happens as part of the 'process-sources'
> build phase.  This can be run explicitly (to format your code prior to
> commit) but is already run prior to the compile phase, so if you are
> building with maven, it will be run for you.
>
> Jenkins will be enforcing that patches moving forward comply with the
> template [2].  If your patch fails this job, ensure you run 'mvn
> process-sources' and resubmit the result.
>
> To migrate outstanding topic branches, it is recommended to do the
> following steps to minimize conflict resolution:
>
> *ade merge cb9ca97531eddee2cd312654bf13b0905cb3ef6e~1 *
> *mvn process-sources -Psource-format -Drat.skip*
> *ade commit -a*
> *ade merge cb9ca97531eddee2cd312654bf13b0905cb3ef6e*
> *ade commit -a*
>
> Let me know if you run into any issues,
>
> Thanks,
>
> -MDB
>
> [1] -
>
> https://cwiki.apache.org/confluence/download/attachments/61322291/AsterixCodeFormatProfile.xml
> [2] -
> https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-source-format/
>