You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hudi.apache.org by Y Ethan Guo <et...@gmail.com> on 2020/02/28 20:47:26 UTC

Re: IDE setup for code formatting

Reviving this thread...

I'm hitting checkstyle issues locally again and thinking that it might be
worth trying GJF.  It interoperates well with IntelliJ and the automated
tool reformats the code in 1 shot as Minh suggested.

If sweeping checkstyle fixes in the codebase disrupts development, we can
temporarily disable checkstyle in this case and for each future PR, we
generate a corresponding cleanup PR just for the changed files (maybe a
script to autogen the clean PR?), to reformat code incrementally.

wdyt?

Best,
- Ethan

On Mon, Dec 23, 2019 at 6:24 PM lamberken@163.com <la...@163.com> wrote:

>

Re: IDE setup for code formatting

Posted by Y Ethan Guo <et...@gmail.com>.
On Fri, Feb 28, 2020 at 9:44 PM Vinoth Chandar <
mail.vinoth.chandar@gmail.com> wrote:

> >>Also, for some files, reformatting in IDE gives me a lot of changes,
> https://hudi.apache.org/contributing#ide-setup save-actions plugin here
> should help here..
>

Thanks, that solves my problem.  Somehow missed it before...


>
> Agree on the other two. We need a coherent strategy to keep. : checkstyle,
> spotless, IDE formatting in sync...
> Without a good design for this, I believe  we will thrash and keep
> reformatting the code.
>

Sounds good.  I'll focus on technical PRs for now before we have a strategy.

Best,
- Ethan


>
> On Fri, Feb 28, 2020 at 4:30 PM Y Ethan Guo <et...@gmail.com>
> wrote:
>
> > Yes.  Mostly when I run `mvn clean package -DskipTests -DskipITs`
> locally,
> > I saw some style issues.  Two main things not well taken care of by the
> > auto reformatting:
> > - The import order.
> > - Depending on the format (new line for the body), the lambda function
> may
> > throw indentation errors.
> >
> > Also, for some files, reformatting in IDE gives me a lot of changes, so
> > sometimes I don't run reformatting to avoid confusion of those changes in
> > the PR.  I guess I need to be more proactive on cleaning up the code I'm
> > touching.
> >
> > Best,
> > - Ethan
> >
> > On Fri, Feb 28, 2020 at 2:33 PM Vinoth Chandar <vi...@apache.org>
> wrote:
> >
> > > Hey Ethan,
> > >
> > > Thanks for raising this up again. Before we go to fixes, may be it
> would
> > > good to summarize the current problems one by one. We can then discuss
> > > options?
> > >
> > > I have been using checkstyle files to format and it’s been tolerable.
> > > Import order etc does not work. But we have turned it off.
> > >
> > > Thanks
> > > Vinoth
> > >
> > > On Fri, Feb 28, 2020 at 12:47 PM Y Ethan Guo <ethan.guoyihua@gmail.com
> >
> > > wrote:
> > >
> > > > Reviving this thread...
> > > >
> > > > I'm hitting checkstyle issues locally again and thinking that it
> might
> > be
> > > > worth trying GJF.  It interoperates well with IntelliJ and the
> > automated
> > > > tool reformats the code in 1 shot as Minh suggested.
> > > >
> > > > If sweeping checkstyle fixes in the codebase disrupts development, we
> > can
> > > > temporarily disable checkstyle in this case and for each future PR,
> we
> > > > generate a corresponding cleanup PR just for the changed files
> (maybe a
> > > > script to autogen the clean PR?), to reformat code incrementally.
> > > >
> > > > wdyt?
> > > >
> > > > Best,
> > > > - Ethan
> > > >
> > > > On Mon, Dec 23, 2019 at 6:24 PM lamberken@163.com <lamberken@163.com
> >
> > > > wrote:
> > > >
> > > > >
> > > >
> > >
> >
>

Re: IDE setup for code formatting

Posted by Vinoth Chandar <ma...@gmail.com>.
>>Also, for some files, reformatting in IDE gives me a lot of changes,
https://hudi.apache.org/contributing#ide-setup save-actions plugin here
should help here..

Agree on the other two. We need a coherent strategy to keep. : checkstyle,
spotless, IDE formatting in sync...
Without a good design for this, I believe  we will thrash and keep
reformatting the code.

On Fri, Feb 28, 2020 at 4:30 PM Y Ethan Guo <et...@gmail.com>
wrote:

> Yes.  Mostly when I run `mvn clean package -DskipTests -DskipITs` locally,
> I saw some style issues.  Two main things not well taken care of by the
> auto reformatting:
> - The import order.
> - Depending on the format (new line for the body), the lambda function may
> throw indentation errors.
>
> Also, for some files, reformatting in IDE gives me a lot of changes, so
> sometimes I don't run reformatting to avoid confusion of those changes in
> the PR.  I guess I need to be more proactive on cleaning up the code I'm
> touching.
>
> Best,
> - Ethan
>
> On Fri, Feb 28, 2020 at 2:33 PM Vinoth Chandar <vi...@apache.org> wrote:
>
> > Hey Ethan,
> >
> > Thanks for raising this up again. Before we go to fixes, may be it would
> > good to summarize the current problems one by one. We can then discuss
> > options?
> >
> > I have been using checkstyle files to format and it’s been tolerable.
> > Import order etc does not work. But we have turned it off.
> >
> > Thanks
> > Vinoth
> >
> > On Fri, Feb 28, 2020 at 12:47 PM Y Ethan Guo <et...@gmail.com>
> > wrote:
> >
> > > Reviving this thread...
> > >
> > > I'm hitting checkstyle issues locally again and thinking that it might
> be
> > > worth trying GJF.  It interoperates well with IntelliJ and the
> automated
> > > tool reformats the code in 1 shot as Minh suggested.
> > >
> > > If sweeping checkstyle fixes in the codebase disrupts development, we
> can
> > > temporarily disable checkstyle in this case and for each future PR, we
> > > generate a corresponding cleanup PR just for the changed files (maybe a
> > > script to autogen the clean PR?), to reformat code incrementally.
> > >
> > > wdyt?
> > >
> > > Best,
> > > - Ethan
> > >
> > > On Mon, Dec 23, 2019 at 6:24 PM lamberken@163.com <la...@163.com>
> > > wrote:
> > >
> > > >
> > >
> >
>

Re: IDE setup for code formatting

Posted by Y Ethan Guo <et...@gmail.com>.
Yes.  Mostly when I run `mvn clean package -DskipTests -DskipITs` locally,
I saw some style issues.  Two main things not well taken care of by the
auto reformatting:
- The import order.
- Depending on the format (new line for the body), the lambda function may
throw indentation errors.

Also, for some files, reformatting in IDE gives me a lot of changes, so
sometimes I don't run reformatting to avoid confusion of those changes in
the PR.  I guess I need to be more proactive on cleaning up the code I'm
touching.

Best,
- Ethan

On Fri, Feb 28, 2020 at 2:33 PM Vinoth Chandar <vi...@apache.org> wrote:

> Hey Ethan,
>
> Thanks for raising this up again. Before we go to fixes, may be it would
> good to summarize the current problems one by one. We can then discuss
> options?
>
> I have been using checkstyle files to format and it’s been tolerable.
> Import order etc does not work. But we have turned it off.
>
> Thanks
> Vinoth
>
> On Fri, Feb 28, 2020 at 12:47 PM Y Ethan Guo <et...@gmail.com>
> wrote:
>
> > Reviving this thread...
> >
> > I'm hitting checkstyle issues locally again and thinking that it might be
> > worth trying GJF.  It interoperates well with IntelliJ and the automated
> > tool reformats the code in 1 shot as Minh suggested.
> >
> > If sweeping checkstyle fixes in the codebase disrupts development, we can
> > temporarily disable checkstyle in this case and for each future PR, we
> > generate a corresponding cleanup PR just for the changed files (maybe a
> > script to autogen the clean PR?), to reformat code incrementally.
> >
> > wdyt?
> >
> > Best,
> > - Ethan
> >
> > On Mon, Dec 23, 2019 at 6:24 PM lamberken@163.com <la...@163.com>
> > wrote:
> >
> > >
> >
>

Re: IDE setup for code formatting

Posted by Vinoth Chandar <vi...@apache.org>.
Hey Ethan,

Thanks for raising this up again. Before we go to fixes, may be it would
good to summarize the current problems one by one. We can then discuss
options?

I have been using checkstyle files to format and it’s been tolerable.
Import order etc does not work. But we have turned it off.

Thanks
Vinoth

On Fri, Feb 28, 2020 at 12:47 PM Y Ethan Guo <et...@gmail.com>
wrote:

> Reviving this thread...
>
> I'm hitting checkstyle issues locally again and thinking that it might be
> worth trying GJF.  It interoperates well with IntelliJ and the automated
> tool reformats the code in 1 shot as Minh suggested.
>
> If sweeping checkstyle fixes in the codebase disrupts development, we can
> temporarily disable checkstyle in this case and for each future PR, we
> generate a corresponding cleanup PR just for the changed files (maybe a
> script to autogen the clean PR?), to reformat code incrementally.
>
> wdyt?
>
> Best,
> - Ethan
>
> On Mon, Dec 23, 2019 at 6:24 PM lamberken@163.com <la...@163.com>
> wrote:
>
> >
>