You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "tungtv202@gmail.com" <tu...@gmail.com> on 2021/06/25 06:14:48 UTC

Should we have a checkstyle for Scala?

Hello guys,

I realize the current checkstyle.xml file doesn't support the Scala 
convention.
Should we have a checkstyle for that?

My suggestion:
- https://github.com/scalastyle/scalastyle

- https://github.com/scalastyle/scalastyle-maven-plugin


Best Regards,

Tung, Van TRAN


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: Should we have a checkstyle for Scala?

Posted by Quan tran hong <qu...@gmail.com>.
+1
I am looking forward to seeing how we select the checkstyle plugin and
configure it for our project.
Quan

Vào Th 6, 25 thg 6, 2021 vào lúc 18:25 btellier@apache.org <
btellier@apache.org> đã viết:

> +1
>
> I would be happy to see contributions on this!
>
> Benoit
>
> On 25/06/2021 13:14, tungtv202@gmail.com wrote:
> > Hello guys,
> >
> > I realize the current checkstyle.xml file doesn't support the Scala
> > convention.
> > Should we have a checkstyle for that?
> >
> > My suggestion:
> > - https://github.com/scalastyle/scalastyle
> >
> > - https://github.com/scalastyle/scalastyle-maven-plugin
> >
> >
> > Best Regards,
> >
> > Tung, Van TRAN
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> > For additional commands, e-mail: server-dev-help@james.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>

Re: Should we have a checkstyle for Scala?

Posted by "btellier@apache.org" <bt...@apache.org>.
+1

I would be happy to see contributions on this!

Benoit

On 25/06/2021 13:14, tungtv202@gmail.com wrote:
> Hello guys,
>
> I realize the current checkstyle.xml file doesn't support the Scala
> convention.
> Should we have a checkstyle for that?
>
> My suggestion:
> - https://github.com/scalastyle/scalastyle
>
> - https://github.com/scalastyle/scalastyle-maven-plugin
>
>
> Best Regards,
>
> Tung, Van TRAN
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: Should we have a checkstyle for Scala?

Posted by Tung Tran Van <tu...@gmail.com>.
> If you are going to upgrade scalafix any why did you chose to stop at
0.9.25
> instead of going for the latest release (0.9.29) ?

I worry about the latest release (0.9.29) using scala 2.13.6, while James
using scala 2.13.4
The first time trying, I got an error. But after several times, fix bit by
bit, Now it works fine. :D
Yeah, I updated my pull request to the latest release.

Thank you, your recommendation is my motivation to experiment more

On Thu, Jul 15, 2021 at 6:28 PM Jean Helou <je...@gmail.com> wrote:

> > I have a pull request to upgrade scalafix-maven-plugin version [1]. I
> hope
> > it will be approvable by the maintainer.
> >
>
> I think there is little chance for it to be approved when there is
> https://github.com/evis/scalafix-maven-plugin/pull/12 but you never know
> If you are going to upgrade scalafix any why did you chose to stop at
> 0.9.25
> instead of going for the latest release (0.9.29) ?
>
>
> > I also have another request to James [2], that implement scalafix tool.
> >
>
> awesome !
>
>
> > [1] https://github.com/evis/scalafix-maven-plugin/pull/15
> > [2] https://github.com/apache/james-project/pull/538
> >
> > Cheers,
> > Tung
> >
> > On Tue, Jul 13, 2021 at 6:59 PM Jean Helou <je...@gmail.com> wrote:
> >
> > > > Yes, I did. I forked this plugin and manual change scala version on
> > > local.
> > > > As I wrote
> > > >
> > >
> > > sorry I didn't catch that in your original email
> > >
> > > > "I got another issue: java.lang.NoSuchMethodError:
> > > > scala.reflect.internal.util.ReusableInstance,
> > > > scala/collection/IterableOnce"
> > > > Maybe need more time to check.
> > > >
> > >
> > > just a thought but the maven plugin hasn't been updated in a while and
> > > pulls scalafix 0.9.23
> > > https://github.com/scalacenter/scalafix/releases/tag/v0.9.26 mentions
> > > scala
> > > 2.13.5 with link to a PR[1] which explicitely mentions the rule you are
> > > trying to use :)
> > >
> > > can you try upgrading scalafix version from 9.23 at least to 9.26 (even
> > > better to 9.29  in your local build ?
> > >
> > > [1] https://github.com/scalacenter/scalafix/pull/1334/files
> > >
> > > cheers,
> > > jean
> > >
> > > Thank you,
> > > >
> > > > On Tue, Jul 13, 2021 at 6:34 PM Jean Helou <je...@gmail.com>
> > wrote:
> > > >
> > > > > This is my configuration
> > > > > >
> > > > >
> > > > > looks good to me, so it looks like the plugin is indeed pinned on
> > scala
> > > > > 2.12, you could clone the repo, change the plugin version to a
> custom
> > > > > version, change references to scala 2.12 to scala 2.13 and run an
> > > install
> > > > > locally to check that having the plugin itself compiled against
> 2.13
> > > > works.
> > > > > if it does you can chime in on the PR to try and get it merged in
> an
> > > > > official manner.
> > > > > What I usually do in such cases is publish an unofficial version of
> > the
> > > > > tool on an unofficial repo and use that until the PR is merged. not
> > > sure
> > > > > how that flies for apache projects though especially since the
> plugin
> > > > uses
> > > > > a BSD3 license.
> > > > > Since it's not a published artifact of the project maybe we are
> > allowed
> > > > to
> > > > > do that as long as we publish the custom build to a public repo ? I
> > > used
> > > > to
> > > > > publish on bintray not sure where to go now ..
> > > > >
> > > > > Regards,
> > > > > Jean
> > > > >
> > > > >
> > > > > > On Tue, Jul 13, 2021 at 5:21 PM Jean Helou <jean.helou@gmail.com
> >
> > > > wrote:
> > > > > >
> > > > > > > Hi Tung,
> > > > > > >
> > > > > > >
> > > > > > > > Very interesting with the rewrite feature of the scalafix
> tool.
> > > > > > > > I tried it for the `jmap-rfc-8621` module. I got an
> > incompatible
> > > > > issue
> > > > > > > with
> > > > > > > > the scala version when trying Semantic Rules.
> > > > > > > >
> > > > > > >
> > > > > > > According to the issue you link to, the plugin only works with
> > > scala
> > > > > 2.12
> > > > > > > and according to the error message you report, the james code
> > base
> > > > uses
> > > > > > > scala 2.13.
> > > > > > > In this case it won't work unless the plugin is cross compiled
> > for
> > > > > 2.13.
> > > > > > > What's intriguing is that the tips and tricks section [1] has a
> > > > sample
> > > > > > > configuration for the semantic db compiler  which seems ot hint
> > > that
> > > > > the
> > > > > > > scala.version can be configured. but i actually doubt it would
> > work
> > > > > > >
> > > > > > > can you share the configuration you used ?
> > > > > > > [1]
> > https://github.com/evis/scalafix-maven-plugin#tips-and-tricks
> > > > > > >
> > > > > > > I don't use the maven plugin itself, all my scala projects use
> > > either
> > > > > SBT
> > > > > > > or mill so I don't have this layer of issues.
> > > > > > >
> > > > > > > Regards,
> > > > > > > Jean
> > > > > > >
> > > > > > > [1] https://github.com/evis/scalafix-maven-plugin/pull/12
> > > > > > > >
> > > > > > > > Regards,
> > > > > > > > Tung
> > > > > > > >
> > > > > > > > On Fri, Jun 25, 2021 at 2:44 PM Jean Helou <
> > jean.helou@gmail.com
> > > >
> > > > > > wrote:
> > > > > > > >
> > > > > > > > > Hi tung,
> > > > > > > > >
> > > > > > > > > Have you looked at scalafix[1]? it seems to be much more
> > > actively
> > > > > > > > > maintained than scalastyle and I feel that it's scope
> > overlaps
> > > > > > > > scalatyle's
> > > > > > > > > quite a bit...
> > > > > > > > >
> > > > > > > > > [1]https://github.com/scalacenter/scalafix
> > > > > > > > >
> > > > > > > > > Regards,
> > > > > > > > > jean
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > On Fri, Jun 25, 2021 at 8:14 AM tungtv202@gmail.com <
> > > > > > > tungtv202@gmail.com
> > > > > > > > >
> > > > > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > Hello guys,
> > > > > > > > > >
> > > > > > > > > > I realize the current checkstyle.xml file doesn't support
> > the
> > > > > Scala
> > > > > > > > > > convention.
> > > > > > > > > > Should we have a checkstyle for that?
> > > > > > > > > >
> > > > > > > > > > My suggestion:
> > > > > > > > > > - https://github.com/scalastyle/scalastyle
> > > > > > > > > >
> > > > > > > > > > - https://github.com/scalastyle/scalastyle-maven-plugin
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Best Regards,
> > > > > > > > > >
> > > > > > > > > > Tung, Van TRAN
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > >
> > ---------------------------------------------------------------------
> > > > > > > > > > To unsubscribe, e-mail:
> > > > server-dev-unsubscribe@james.apache.org
> > > > > > > > > > For additional commands, e-mail:
> > > > > server-dev-help@james.apache.org
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > Tung, Tran Van
> > > > > > > > *Phone:* (+84) 35 757 6258
> > > > > > > > *Skype:* tung.tv202
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Tung, Tran Van
> > > > > > *Phone:* (+84) 35 757 6258
> > > > > > *Skype:* tung.tv202
> > > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Tung, Tran Van
> > > > *Phone:* (+84) 35 757 6258
> > > > *Skype:* tung.tv202
> > > >
> > >
> >
> >
> > --
> > Tung, Tran Van
> > *Phone:* (+84) 35 757 6258
> > *Skype:* tung.tv202
> >
>


-- 
Tung, Tran Van
*Phone:* (+84) 35 757 6258
*Skype:* tung.tv202

Re: Should we have a checkstyle for Scala?

Posted by Jean Helou <je...@gmail.com>.
> I have a pull request to upgrade scalafix-maven-plugin version [1]. I hope
> it will be approvable by the maintainer.
>

I think there is little chance for it to be approved when there is
https://github.com/evis/scalafix-maven-plugin/pull/12 but you never know
If you are going to upgrade scalafix any why did you chose to stop at 0.9.25
instead of going for the latest release (0.9.29) ?


> I also have another request to James [2], that implement scalafix tool.
>

awesome !


> [1] https://github.com/evis/scalafix-maven-plugin/pull/15
> [2] https://github.com/apache/james-project/pull/538
>
> Cheers,
> Tung
>
> On Tue, Jul 13, 2021 at 6:59 PM Jean Helou <je...@gmail.com> wrote:
>
> > > Yes, I did. I forked this plugin and manual change scala version on
> > local.
> > > As I wrote
> > >
> >
> > sorry I didn't catch that in your original email
> >
> > > "I got another issue: java.lang.NoSuchMethodError:
> > > scala.reflect.internal.util.ReusableInstance,
> > > scala/collection/IterableOnce"
> > > Maybe need more time to check.
> > >
> >
> > just a thought but the maven plugin hasn't been updated in a while and
> > pulls scalafix 0.9.23
> > https://github.com/scalacenter/scalafix/releases/tag/v0.9.26 mentions
> > scala
> > 2.13.5 with link to a PR[1] which explicitely mentions the rule you are
> > trying to use :)
> >
> > can you try upgrading scalafix version from 9.23 at least to 9.26 (even
> > better to 9.29  in your local build ?
> >
> > [1] https://github.com/scalacenter/scalafix/pull/1334/files
> >
> > cheers,
> > jean
> >
> > Thank you,
> > >
> > > On Tue, Jul 13, 2021 at 6:34 PM Jean Helou <je...@gmail.com>
> wrote:
> > >
> > > > This is my configuration
> > > > >
> > > >
> > > > looks good to me, so it looks like the plugin is indeed pinned on
> scala
> > > > 2.12, you could clone the repo, change the plugin version to a custom
> > > > version, change references to scala 2.12 to scala 2.13 and run an
> > install
> > > > locally to check that having the plugin itself compiled against 2.13
> > > works.
> > > > if it does you can chime in on the PR to try and get it merged in an
> > > > official manner.
> > > > What I usually do in such cases is publish an unofficial version of
> the
> > > > tool on an unofficial repo and use that until the PR is merged. not
> > sure
> > > > how that flies for apache projects though especially since the plugin
> > > uses
> > > > a BSD3 license.
> > > > Since it's not a published artifact of the project maybe we are
> allowed
> > > to
> > > > do that as long as we publish the custom build to a public repo ? I
> > used
> > > to
> > > > publish on bintray not sure where to go now ..
> > > >
> > > > Regards,
> > > > Jean
> > > >
> > > >
> > > > > On Tue, Jul 13, 2021 at 5:21 PM Jean Helou <je...@gmail.com>
> > > wrote:
> > > > >
> > > > > > Hi Tung,
> > > > > >
> > > > > >
> > > > > > > Very interesting with the rewrite feature of the scalafix tool.
> > > > > > > I tried it for the `jmap-rfc-8621` module. I got an
> incompatible
> > > > issue
> > > > > > with
> > > > > > > the scala version when trying Semantic Rules.
> > > > > > >
> > > > > >
> > > > > > According to the issue you link to, the plugin only works with
> > scala
> > > > 2.12
> > > > > > and according to the error message you report, the james code
> base
> > > uses
> > > > > > scala 2.13.
> > > > > > In this case it won't work unless the plugin is cross compiled
> for
> > > > 2.13.
> > > > > > What's intriguing is that the tips and tricks section [1] has a
> > > sample
> > > > > > configuration for the semantic db compiler  which seems ot hint
> > that
> > > > the
> > > > > > scala.version can be configured. but i actually doubt it would
> work
> > > > > >
> > > > > > can you share the configuration you used ?
> > > > > > [1]
> https://github.com/evis/scalafix-maven-plugin#tips-and-tricks
> > > > > >
> > > > > > I don't use the maven plugin itself, all my scala projects use
> > either
> > > > SBT
> > > > > > or mill so I don't have this layer of issues.
> > > > > >
> > > > > > Regards,
> > > > > > Jean
> > > > > >
> > > > > > [1] https://github.com/evis/scalafix-maven-plugin/pull/12
> > > > > > >
> > > > > > > Regards,
> > > > > > > Tung
> > > > > > >
> > > > > > > On Fri, Jun 25, 2021 at 2:44 PM Jean Helou <
> jean.helou@gmail.com
> > >
> > > > > wrote:
> > > > > > >
> > > > > > > > Hi tung,
> > > > > > > >
> > > > > > > > Have you looked at scalafix[1]? it seems to be much more
> > actively
> > > > > > > > maintained than scalastyle and I feel that it's scope
> overlaps
> > > > > > > scalatyle's
> > > > > > > > quite a bit...
> > > > > > > >
> > > > > > > > [1]https://github.com/scalacenter/scalafix
> > > > > > > >
> > > > > > > > Regards,
> > > > > > > > jean
> > > > > > > >
> > > > > > > >
> > > > > > > > On Fri, Jun 25, 2021 at 8:14 AM tungtv202@gmail.com <
> > > > > > tungtv202@gmail.com
> > > > > > > >
> > > > > > > > wrote:
> > > > > > > >
> > > > > > > > > Hello guys,
> > > > > > > > >
> > > > > > > > > I realize the current checkstyle.xml file doesn't support
> the
> > > > Scala
> > > > > > > > > convention.
> > > > > > > > > Should we have a checkstyle for that?
> > > > > > > > >
> > > > > > > > > My suggestion:
> > > > > > > > > - https://github.com/scalastyle/scalastyle
> > > > > > > > >
> > > > > > > > > - https://github.com/scalastyle/scalastyle-maven-plugin
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Best Regards,
> > > > > > > > >
> > > > > > > > > Tung, Van TRAN
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > > > > > To unsubscribe, e-mail:
> > > server-dev-unsubscribe@james.apache.org
> > > > > > > > > For additional commands, e-mail:
> > > > server-dev-help@james.apache.org
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Tung, Tran Van
> > > > > > > *Phone:* (+84) 35 757 6258
> > > > > > > *Skype:* tung.tv202
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Tung, Tran Van
> > > > > *Phone:* (+84) 35 757 6258
> > > > > *Skype:* tung.tv202
> > > > >
> > > >
> > >
> > >
> > > --
> > > Tung, Tran Van
> > > *Phone:* (+84) 35 757 6258
> > > *Skype:* tung.tv202
> > >
> >
>
>
> --
> Tung, Tran Van
> *Phone:* (+84) 35 757 6258
> *Skype:* tung.tv202
>

Re: Should we have a checkstyle for Scala?

Posted by Tung Tran Van <tu...@gmail.com>.
Hello,
I have a pull request to upgrade scalafix-maven-plugin version [1]. I hope
it will be approvable by the maintainer.
I also have another request to James [2], that implement scalafix tool.

[1] https://github.com/evis/scalafix-maven-plugin/pull/15
[2] https://github.com/apache/james-project/pull/538

Cheers,
Tung

On Tue, Jul 13, 2021 at 6:59 PM Jean Helou <je...@gmail.com> wrote:

> > Yes, I did. I forked this plugin and manual change scala version on
> local.
> > As I wrote
> >
>
> sorry I didn't catch that in your original email
>
> > "I got another issue: java.lang.NoSuchMethodError:
> > scala.reflect.internal.util.ReusableInstance,
> > scala/collection/IterableOnce"
> > Maybe need more time to check.
> >
>
> just a thought but the maven plugin hasn't been updated in a while and
> pulls scalafix 0.9.23
> https://github.com/scalacenter/scalafix/releases/tag/v0.9.26 mentions
> scala
> 2.13.5 with link to a PR[1] which explicitely mentions the rule you are
> trying to use :)
>
> can you try upgrading scalafix version from 9.23 at least to 9.26 (even
> better to 9.29  in your local build ?
>
> [1] https://github.com/scalacenter/scalafix/pull/1334/files
>
> cheers,
> jean
>
> Thank you,
> >
> > On Tue, Jul 13, 2021 at 6:34 PM Jean Helou <je...@gmail.com> wrote:
> >
> > > This is my configuration
> > > >
> > >
> > > looks good to me, so it looks like the plugin is indeed pinned on scala
> > > 2.12, you could clone the repo, change the plugin version to a custom
> > > version, change references to scala 2.12 to scala 2.13 and run an
> install
> > > locally to check that having the plugin itself compiled against 2.13
> > works.
> > > if it does you can chime in on the PR to try and get it merged in an
> > > official manner.
> > > What I usually do in such cases is publish an unofficial version of the
> > > tool on an unofficial repo and use that until the PR is merged. not
> sure
> > > how that flies for apache projects though especially since the plugin
> > uses
> > > a BSD3 license.
> > > Since it's not a published artifact of the project maybe we are allowed
> > to
> > > do that as long as we publish the custom build to a public repo ? I
> used
> > to
> > > publish on bintray not sure where to go now ..
> > >
> > > Regards,
> > > Jean
> > >
> > >
> > > > On Tue, Jul 13, 2021 at 5:21 PM Jean Helou <je...@gmail.com>
> > wrote:
> > > >
> > > > > Hi Tung,
> > > > >
> > > > >
> > > > > > Very interesting with the rewrite feature of the scalafix tool.
> > > > > > I tried it for the `jmap-rfc-8621` module. I got an incompatible
> > > issue
> > > > > with
> > > > > > the scala version when trying Semantic Rules.
> > > > > >
> > > > >
> > > > > According to the issue you link to, the plugin only works with
> scala
> > > 2.12
> > > > > and according to the error message you report, the james code base
> > uses
> > > > > scala 2.13.
> > > > > In this case it won't work unless the plugin is cross compiled for
> > > 2.13.
> > > > > What's intriguing is that the tips and tricks section [1] has a
> > sample
> > > > > configuration for the semantic db compiler  which seems ot hint
> that
> > > the
> > > > > scala.version can be configured. but i actually doubt it would work
> > > > >
> > > > > can you share the configuration you used ?
> > > > > [1] https://github.com/evis/scalafix-maven-plugin#tips-and-tricks
> > > > >
> > > > > I don't use the maven plugin itself, all my scala projects use
> either
> > > SBT
> > > > > or mill so I don't have this layer of issues.
> > > > >
> > > > > Regards,
> > > > > Jean
> > > > >
> > > > > [1] https://github.com/evis/scalafix-maven-plugin/pull/12
> > > > > >
> > > > > > Regards,
> > > > > > Tung
> > > > > >
> > > > > > On Fri, Jun 25, 2021 at 2:44 PM Jean Helou <jean.helou@gmail.com
> >
> > > > wrote:
> > > > > >
> > > > > > > Hi tung,
> > > > > > >
> > > > > > > Have you looked at scalafix[1]? it seems to be much more
> actively
> > > > > > > maintained than scalastyle and I feel that it's scope overlaps
> > > > > > scalatyle's
> > > > > > > quite a bit...
> > > > > > >
> > > > > > > [1]https://github.com/scalacenter/scalafix
> > > > > > >
> > > > > > > Regards,
> > > > > > > jean
> > > > > > >
> > > > > > >
> > > > > > > On Fri, Jun 25, 2021 at 8:14 AM tungtv202@gmail.com <
> > > > > tungtv202@gmail.com
> > > > > > >
> > > > > > > wrote:
> > > > > > >
> > > > > > > > Hello guys,
> > > > > > > >
> > > > > > > > I realize the current checkstyle.xml file doesn't support the
> > > Scala
> > > > > > > > convention.
> > > > > > > > Should we have a checkstyle for that?
> > > > > > > >
> > > > > > > > My suggestion:
> > > > > > > > - https://github.com/scalastyle/scalastyle
> > > > > > > >
> > > > > > > > - https://github.com/scalastyle/scalastyle-maven-plugin
> > > > > > > >
> > > > > > > >
> > > > > > > > Best Regards,
> > > > > > > >
> > > > > > > > Tung, Van TRAN
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > ---------------------------------------------------------------------
> > > > > > > > To unsubscribe, e-mail:
> > server-dev-unsubscribe@james.apache.org
> > > > > > > > For additional commands, e-mail:
> > > server-dev-help@james.apache.org
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Tung, Tran Van
> > > > > > *Phone:* (+84) 35 757 6258
> > > > > > *Skype:* tung.tv202
> > > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Tung, Tran Van
> > > > *Phone:* (+84) 35 757 6258
> > > > *Skype:* tung.tv202
> > > >
> > >
> >
> >
> > --
> > Tung, Tran Van
> > *Phone:* (+84) 35 757 6258
> > *Skype:* tung.tv202
> >
>


-- 
Tung, Tran Van
*Phone:* (+84) 35 757 6258
*Skype:* tung.tv202

Re: Should we have a checkstyle for Scala?

Posted by Jean Helou <je...@gmail.com>.
> Yes, I did. I forked this plugin and manual change scala version on local.
> As I wrote
>

sorry I didn't catch that in your original email

> "I got another issue: java.lang.NoSuchMethodError:
> scala.reflect.internal.util.ReusableInstance,
> scala/collection/IterableOnce"
> Maybe need more time to check.
>

just a thought but the maven plugin hasn't been updated in a while and
pulls scalafix 0.9.23
https://github.com/scalacenter/scalafix/releases/tag/v0.9.26 mentions scala
2.13.5 with link to a PR[1] which explicitely mentions the rule you are
trying to use :)

can you try upgrading scalafix version from 9.23 at least to 9.26 (even
better to 9.29  in your local build ?

[1] https://github.com/scalacenter/scalafix/pull/1334/files

cheers,
jean

Thank you,
>
> On Tue, Jul 13, 2021 at 6:34 PM Jean Helou <je...@gmail.com> wrote:
>
> > This is my configuration
> > >
> >
> > looks good to me, so it looks like the plugin is indeed pinned on scala
> > 2.12, you could clone the repo, change the plugin version to a custom
> > version, change references to scala 2.12 to scala 2.13 and run an install
> > locally to check that having the plugin itself compiled against 2.13
> works.
> > if it does you can chime in on the PR to try and get it merged in an
> > official manner.
> > What I usually do in such cases is publish an unofficial version of the
> > tool on an unofficial repo and use that until the PR is merged. not sure
> > how that flies for apache projects though especially since the plugin
> uses
> > a BSD3 license.
> > Since it's not a published artifact of the project maybe we are allowed
> to
> > do that as long as we publish the custom build to a public repo ? I used
> to
> > publish on bintray not sure where to go now ..
> >
> > Regards,
> > Jean
> >
> >
> > > On Tue, Jul 13, 2021 at 5:21 PM Jean Helou <je...@gmail.com>
> wrote:
> > >
> > > > Hi Tung,
> > > >
> > > >
> > > > > Very interesting with the rewrite feature of the scalafix tool.
> > > > > I tried it for the `jmap-rfc-8621` module. I got an incompatible
> > issue
> > > > with
> > > > > the scala version when trying Semantic Rules.
> > > > >
> > > >
> > > > According to the issue you link to, the plugin only works with scala
> > 2.12
> > > > and according to the error message you report, the james code base
> uses
> > > > scala 2.13.
> > > > In this case it won't work unless the plugin is cross compiled for
> > 2.13.
> > > > What's intriguing is that the tips and tricks section [1] has a
> sample
> > > > configuration for the semantic db compiler  which seems ot hint that
> > the
> > > > scala.version can be configured. but i actually doubt it would work
> > > >
> > > > can you share the configuration you used ?
> > > > [1] https://github.com/evis/scalafix-maven-plugin#tips-and-tricks
> > > >
> > > > I don't use the maven plugin itself, all my scala projects use either
> > SBT
> > > > or mill so I don't have this layer of issues.
> > > >
> > > > Regards,
> > > > Jean
> > > >
> > > > [1] https://github.com/evis/scalafix-maven-plugin/pull/12
> > > > >
> > > > > Regards,
> > > > > Tung
> > > > >
> > > > > On Fri, Jun 25, 2021 at 2:44 PM Jean Helou <je...@gmail.com>
> > > wrote:
> > > > >
> > > > > > Hi tung,
> > > > > >
> > > > > > Have you looked at scalafix[1]? it seems to be much more actively
> > > > > > maintained than scalastyle and I feel that it's scope overlaps
> > > > > scalatyle's
> > > > > > quite a bit...
> > > > > >
> > > > > > [1]https://github.com/scalacenter/scalafix
> > > > > >
> > > > > > Regards,
> > > > > > jean
> > > > > >
> > > > > >
> > > > > > On Fri, Jun 25, 2021 at 8:14 AM tungtv202@gmail.com <
> > > > tungtv202@gmail.com
> > > > > >
> > > > > > wrote:
> > > > > >
> > > > > > > Hello guys,
> > > > > > >
> > > > > > > I realize the current checkstyle.xml file doesn't support the
> > Scala
> > > > > > > convention.
> > > > > > > Should we have a checkstyle for that?
> > > > > > >
> > > > > > > My suggestion:
> > > > > > > - https://github.com/scalastyle/scalastyle
> > > > > > >
> > > > > > > - https://github.com/scalastyle/scalastyle-maven-plugin
> > > > > > >
> > > > > > >
> > > > > > > Best Regards,
> > > > > > >
> > > > > > > Tung, Van TRAN
> > > > > > >
> > > > > > >
> > > > > > >
> > > ---------------------------------------------------------------------
> > > > > > > To unsubscribe, e-mail:
> server-dev-unsubscribe@james.apache.org
> > > > > > > For additional commands, e-mail:
> > server-dev-help@james.apache.org
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Tung, Tran Van
> > > > > *Phone:* (+84) 35 757 6258
> > > > > *Skype:* tung.tv202
> > > > >
> > > >
> > >
> > >
> > > --
> > > Tung, Tran Van
> > > *Phone:* (+84) 35 757 6258
> > > *Skype:* tung.tv202
> > >
> >
>
>
> --
> Tung, Tran Van
> *Phone:* (+84) 35 757 6258
> *Skype:* tung.tv202
>

Re: Should we have a checkstyle for Scala?

Posted by Tung Tran Van <tu...@gmail.com>.
> you could clone the repo, change the plugin version to a custom
> version, change references to scala 2.12 to scala 2.13 and run an install
> locally

Yes, I did. I forked this plugin and manual change scala version on local.
As I wrote
> "I got another issue: java.lang.NoSuchMethodError:
scala.reflect.internal.util.ReusableInstance, scala/collection/IterableOnce"
Maybe need more time to check.

Thank you,

On Tue, Jul 13, 2021 at 6:34 PM Jean Helou <je...@gmail.com> wrote:

> This is my configuration
> >
>
> looks good to me, so it looks like the plugin is indeed pinned on scala
> 2.12, you could clone the repo, change the plugin version to a custom
> version, change references to scala 2.12 to scala 2.13 and run an install
> locally to check that having the plugin itself compiled against 2.13 works.
> if it does you can chime in on the PR to try and get it merged in an
> official manner.
> What I usually do in such cases is publish an unofficial version of the
> tool on an unofficial repo and use that until the PR is merged. not sure
> how that flies for apache projects though especially since the plugin uses
> a BSD3 license.
> Since it's not a published artifact of the project maybe we are allowed to
> do that as long as we publish the custom build to a public repo ? I used to
> publish on bintray not sure where to go now ..
>
> Regards,
> Jean
>
>
> > On Tue, Jul 13, 2021 at 5:21 PM Jean Helou <je...@gmail.com> wrote:
> >
> > > Hi Tung,
> > >
> > >
> > > > Very interesting with the rewrite feature of the scalafix tool.
> > > > I tried it for the `jmap-rfc-8621` module. I got an incompatible
> issue
> > > with
> > > > the scala version when trying Semantic Rules.
> > > >
> > >
> > > According to the issue you link to, the plugin only works with scala
> 2.12
> > > and according to the error message you report, the james code base uses
> > > scala 2.13.
> > > In this case it won't work unless the plugin is cross compiled for
> 2.13.
> > > What's intriguing is that the tips and tricks section [1] has a sample
> > > configuration for the semantic db compiler  which seems ot hint that
> the
> > > scala.version can be configured. but i actually doubt it would work
> > >
> > > can you share the configuration you used ?
> > > [1] https://github.com/evis/scalafix-maven-plugin#tips-and-tricks
> > >
> > > I don't use the maven plugin itself, all my scala projects use either
> SBT
> > > or mill so I don't have this layer of issues.
> > >
> > > Regards,
> > > Jean
> > >
> > > [1] https://github.com/evis/scalafix-maven-plugin/pull/12
> > > >
> > > > Regards,
> > > > Tung
> > > >
> > > > On Fri, Jun 25, 2021 at 2:44 PM Jean Helou <je...@gmail.com>
> > wrote:
> > > >
> > > > > Hi tung,
> > > > >
> > > > > Have you looked at scalafix[1]? it seems to be much more actively
> > > > > maintained than scalastyle and I feel that it's scope overlaps
> > > > scalatyle's
> > > > > quite a bit...
> > > > >
> > > > > [1]https://github.com/scalacenter/scalafix
> > > > >
> > > > > Regards,
> > > > > jean
> > > > >
> > > > >
> > > > > On Fri, Jun 25, 2021 at 8:14 AM tungtv202@gmail.com <
> > > tungtv202@gmail.com
> > > > >
> > > > > wrote:
> > > > >
> > > > > > Hello guys,
> > > > > >
> > > > > > I realize the current checkstyle.xml file doesn't support the
> Scala
> > > > > > convention.
> > > > > > Should we have a checkstyle for that?
> > > > > >
> > > > > > My suggestion:
> > > > > > - https://github.com/scalastyle/scalastyle
> > > > > >
> > > > > > - https://github.com/scalastyle/scalastyle-maven-plugin
> > > > > >
> > > > > >
> > > > > > Best Regards,
> > > > > >
> > > > > > Tung, Van TRAN
> > > > > >
> > > > > >
> > > > > >
> > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> > > > > > For additional commands, e-mail:
> server-dev-help@james.apache.org
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Tung, Tran Van
> > > > *Phone:* (+84) 35 757 6258
> > > > *Skype:* tung.tv202
> > > >
> > >
> >
> >
> > --
> > Tung, Tran Van
> > *Phone:* (+84) 35 757 6258
> > *Skype:* tung.tv202
> >
>


-- 
Tung, Tran Van
*Phone:* (+84) 35 757 6258
*Skype:* tung.tv202

Re: Should we have a checkstyle for Scala?

Posted by Jean Helou <je...@gmail.com>.
This is my configuration
>

looks good to me, so it looks like the plugin is indeed pinned on scala
2.12, you could clone the repo, change the plugin version to a custom
version, change references to scala 2.12 to scala 2.13 and run an install
locally to check that having the plugin itself compiled against 2.13 works.
if it does you can chime in on the PR to try and get it merged in an
official manner.
What I usually do in such cases is publish an unofficial version of the
tool on an unofficial repo and use that until the PR is merged. not sure
how that flies for apache projects though especially since the plugin uses
a BSD3 license.
Since it's not a published artifact of the project maybe we are allowed to
do that as long as we publish the custom build to a public repo ? I used to
publish on bintray not sure where to go now ..

Regards,
Jean


> On Tue, Jul 13, 2021 at 5:21 PM Jean Helou <je...@gmail.com> wrote:
>
> > Hi Tung,
> >
> >
> > > Very interesting with the rewrite feature of the scalafix tool.
> > > I tried it for the `jmap-rfc-8621` module. I got an incompatible issue
> > with
> > > the scala version when trying Semantic Rules.
> > >
> >
> > According to the issue you link to, the plugin only works with scala 2.12
> > and according to the error message you report, the james code base uses
> > scala 2.13.
> > In this case it won't work unless the plugin is cross compiled for 2.13.
> > What's intriguing is that the tips and tricks section [1] has a sample
> > configuration for the semantic db compiler  which seems ot hint that the
> > scala.version can be configured. but i actually doubt it would work
> >
> > can you share the configuration you used ?
> > [1] https://github.com/evis/scalafix-maven-plugin#tips-and-tricks
> >
> > I don't use the maven plugin itself, all my scala projects use either SBT
> > or mill so I don't have this layer of issues.
> >
> > Regards,
> > Jean
> >
> > [1] https://github.com/evis/scalafix-maven-plugin/pull/12
> > >
> > > Regards,
> > > Tung
> > >
> > > On Fri, Jun 25, 2021 at 2:44 PM Jean Helou <je...@gmail.com>
> wrote:
> > >
> > > > Hi tung,
> > > >
> > > > Have you looked at scalafix[1]? it seems to be much more actively
> > > > maintained than scalastyle and I feel that it's scope overlaps
> > > scalatyle's
> > > > quite a bit...
> > > >
> > > > [1]https://github.com/scalacenter/scalafix
> > > >
> > > > Regards,
> > > > jean
> > > >
> > > >
> > > > On Fri, Jun 25, 2021 at 8:14 AM tungtv202@gmail.com <
> > tungtv202@gmail.com
> > > >
> > > > wrote:
> > > >
> > > > > Hello guys,
> > > > >
> > > > > I realize the current checkstyle.xml file doesn't support the Scala
> > > > > convention.
> > > > > Should we have a checkstyle for that?
> > > > >
> > > > > My suggestion:
> > > > > - https://github.com/scalastyle/scalastyle
> > > > >
> > > > > - https://github.com/scalastyle/scalastyle-maven-plugin
> > > > >
> > > > >
> > > > > Best Regards,
> > > > >
> > > > > Tung, Van TRAN
> > > > >
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> > > > > For additional commands, e-mail: server-dev-help@james.apache.org
> > > > >
> > > > >
> > > >
> > >
> > >
> > > --
> > > Tung, Tran Van
> > > *Phone:* (+84) 35 757 6258
> > > *Skype:* tung.tv202
> > >
> >
>
>
> --
> Tung, Tran Van
> *Phone:* (+84) 35 757 6258
> *Skype:* tung.tv202
>

Re: Should we have a checkstyle for Scala?

Posted by Tung Tran Van <tu...@gmail.com>.
Hi Jean

This is my configuration

```
<plugin>
<groupId>io.github.evis</groupId>
<artifactId>scalafix-maven-plugin</artifactId>
<version>0.1.4_0.9.23</version>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.4.6</version>
<configuration>
<args>
<arg>-Ywarn-unused</arg>
</args>
<compilerPlugins>
<compilerPlugin>
<groupId>org.scalameta</groupId>
<artifactId>semanticdb-scalac_2.13.4</artifactId>
<version>4.4.23</version>
</compilerPlugin>
</compilerPlugins>
</configuration>
</plugin>
```
James scala current version: 2.13.4

- *.scalafix.conf *file
*```*
rules = [
  ExplicitResultTypes,
]
```

> What's intriguing is that the tips and tricks section [1] has a sample
> configuration for the semantic db compiler  which seems ot hint that the
> scala.version can be configured.
I tried, but it not working.

Regards,
Tung


On Tue, Jul 13, 2021 at 5:21 PM Jean Helou <je...@gmail.com> wrote:

> Hi Tung,
>
>
> > Very interesting with the rewrite feature of the scalafix tool.
> > I tried it for the `jmap-rfc-8621` module. I got an incompatible issue
> with
> > the scala version when trying Semantic Rules.
> >
>
> According to the issue you link to, the plugin only works with scala 2.12
> and according to the error message you report, the james code base uses
> scala 2.13.
> In this case it won't work unless the plugin is cross compiled for 2.13.
> What's intriguing is that the tips and tricks section [1] has a sample
> configuration for the semantic db compiler  which seems ot hint that the
> scala.version can be configured. but i actually doubt it would work
>
> can you share the configuration you used ?
> [1] https://github.com/evis/scalafix-maven-plugin#tips-and-tricks
>
> I don't use the maven plugin itself, all my scala projects use either SBT
> or mill so I don't have this layer of issues.
>
> Regards,
> Jean
>
> [1] https://github.com/evis/scalafix-maven-plugin/pull/12
> >
> > Regards,
> > Tung
> >
> > On Fri, Jun 25, 2021 at 2:44 PM Jean Helou <je...@gmail.com> wrote:
> >
> > > Hi tung,
> > >
> > > Have you looked at scalafix[1]? it seems to be much more actively
> > > maintained than scalastyle and I feel that it's scope overlaps
> > scalatyle's
> > > quite a bit...
> > >
> > > [1]https://github.com/scalacenter/scalafix
> > >
> > > Regards,
> > > jean
> > >
> > >
> > > On Fri, Jun 25, 2021 at 8:14 AM tungtv202@gmail.com <
> tungtv202@gmail.com
> > >
> > > wrote:
> > >
> > > > Hello guys,
> > > >
> > > > I realize the current checkstyle.xml file doesn't support the Scala
> > > > convention.
> > > > Should we have a checkstyle for that?
> > > >
> > > > My suggestion:
> > > > - https://github.com/scalastyle/scalastyle
> > > >
> > > > - https://github.com/scalastyle/scalastyle-maven-plugin
> > > >
> > > >
> > > > Best Regards,
> > > >
> > > > Tung, Van TRAN
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> > > > For additional commands, e-mail: server-dev-help@james.apache.org
> > > >
> > > >
> > >
> >
> >
> > --
> > Tung, Tran Van
> > *Phone:* (+84) 35 757 6258
> > *Skype:* tung.tv202
> >
>


-- 
Tung, Tran Van
*Phone:* (+84) 35 757 6258
*Skype:* tung.tv202

Re: Should we have a checkstyle for Scala?

Posted by Jean Helou <je...@gmail.com>.
Hi Tung,


> Very interesting with the rewrite feature of the scalafix tool.
> I tried it for the `jmap-rfc-8621` module. I got an incompatible issue with
> the scala version when trying Semantic Rules.
>

According to the issue you link to, the plugin only works with scala 2.12
and according to the error message you report, the james code base uses
scala 2.13.
In this case it won't work unless the plugin is cross compiled for 2.13.
What's intriguing is that the tips and tricks section [1] has a sample
configuration for the semantic db compiler  which seems ot hint that the
scala.version can be configured. but i actually doubt it would work

can you share the configuration you used ?
[1] https://github.com/evis/scalafix-maven-plugin#tips-and-tricks

I don't use the maven plugin itself, all my scala projects use either SBT
or mill so I don't have this layer of issues.

Regards,
Jean

[1] https://github.com/evis/scalafix-maven-plugin/pull/12
>
> Regards,
> Tung
>
> On Fri, Jun 25, 2021 at 2:44 PM Jean Helou <je...@gmail.com> wrote:
>
> > Hi tung,
> >
> > Have you looked at scalafix[1]? it seems to be much more actively
> > maintained than scalastyle and I feel that it's scope overlaps
> scalatyle's
> > quite a bit...
> >
> > [1]https://github.com/scalacenter/scalafix
> >
> > Regards,
> > jean
> >
> >
> > On Fri, Jun 25, 2021 at 8:14 AM tungtv202@gmail.com <tungtv202@gmail.com
> >
> > wrote:
> >
> > > Hello guys,
> > >
> > > I realize the current checkstyle.xml file doesn't support the Scala
> > > convention.
> > > Should we have a checkstyle for that?
> > >
> > > My suggestion:
> > > - https://github.com/scalastyle/scalastyle
> > >
> > > - https://github.com/scalastyle/scalastyle-maven-plugin
> > >
> > >
> > > Best Regards,
> > >
> > > Tung, Van TRAN
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> > > For additional commands, e-mail: server-dev-help@james.apache.org
> > >
> > >
> >
>
>
> --
> Tung, Tran Van
> *Phone:* (+84) 35 757 6258
> *Skype:* tung.tv202
>

Re: Should we have a checkstyle for Scala?

Posted by Tung Tran Van <tu...@gmail.com>.
Hi Jean,

Very interesting with the rewrite feature of the scalafix tool.
I tried it for the `jmap-rfc-8621` module. I got an incompatible issue with
the scala version when trying Semantic Rules.
Perhaps this is a bug that has not been resolved until now? [1]
Error detail:
- error: The ExplicitResultTypes rule needs to run with the same Scala
binary version as the one used to compile target sources (2.13). To fix
this problem, either remove ExplicitResultTypes from .scalafix.conf or make
sure the scalafixScalaBinaryVersion setting key matches 2.13.
- When I tried with another version, I got another
issue: java.lang.NoSuchMethodError:
scala.reflect.internal.util.ReusableInstance, scala/collection/IterableOnce.

But, it works fine with Syntactic Rules. So does it make more sense? Do you
get the same error?

[1] https://github.com/evis/scalafix-maven-plugin/pull/12

Regards,
Tung

On Fri, Jun 25, 2021 at 2:44 PM Jean Helou <je...@gmail.com> wrote:

> Hi tung,
>
> Have you looked at scalafix[1]? it seems to be much more actively
> maintained than scalastyle and I feel that it's scope overlaps scalatyle's
> quite a bit...
>
> [1]https://github.com/scalacenter/scalafix
>
> Regards,
> jean
>
>
> On Fri, Jun 25, 2021 at 8:14 AM tungtv202@gmail.com <tu...@gmail.com>
> wrote:
>
> > Hello guys,
> >
> > I realize the current checkstyle.xml file doesn't support the Scala
> > convention.
> > Should we have a checkstyle for that?
> >
> > My suggestion:
> > - https://github.com/scalastyle/scalastyle
> >
> > - https://github.com/scalastyle/scalastyle-maven-plugin
> >
> >
> > Best Regards,
> >
> > Tung, Van TRAN
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> > For additional commands, e-mail: server-dev-help@james.apache.org
> >
> >
>


-- 
Tung, Tran Van
*Phone:* (+84) 35 757 6258
*Skype:* tung.tv202

Re: Should we have a checkstyle for Scala?

Posted by Jean Helou <je...@gmail.com>.
Hi tung,

Have you looked at scalafix[1]? it seems to be much more actively
maintained than scalastyle and I feel that it's scope overlaps scalatyle's
quite a bit...

[1]https://github.com/scalacenter/scalafix

Regards,
jean


On Fri, Jun 25, 2021 at 8:14 AM tungtv202@gmail.com <tu...@gmail.com>
wrote:

> Hello guys,
>
> I realize the current checkstyle.xml file doesn't support the Scala
> convention.
> Should we have a checkstyle for that?
>
> My suggestion:
> - https://github.com/scalastyle/scalastyle
>
> - https://github.com/scalastyle/scalastyle-maven-plugin
>
>
> Best Regards,
>
> Tung, Van TRAN
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>