You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Vladimir Sitnikov (JIRA)" <ji...@apache.org> on 2014/07/06 10:20:33 UTC
[jira] [Commented] (OPTIQ-306) Standardize code style for "import
package.*;"
[ https://issues.apache.org/jira/browse/OPTIQ-306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14053062#comment-14053062 ]
Vladimir Sitnikov commented on OPTIQ-306:
-----------------------------------------
I've tried improving checkstyle's reporting of "invalid import order", and got rejected by checkstyle maintainers: [discussion int the dev list|https://groups.google.com/forum/#!topic/checkstyle-devel/ln3rJd5_gbI], [github pull request|https://github.com/checkstyle/checkstyle/pull/164].
Thus I would drop any "smart" rules like "if this source file is in the org.apache.optiq package space" since I see very little help from them, and they will definitely catch and annoy optiq contributors.
I am not sure if we want forking checkstyle. I would spend some time on optiq rather than checkstyle part of it.
#1, #3, #4 and #5 are fine.
> Standardize code style for "import package.*;"
> ----------------------------------------------
>
> Key: OPTIQ-306
> URL: https://issues.apache.org/jira/browse/OPTIQ-306
> Project: Optiq
> Issue Type: Improvement
> Reporter: Julian Hyde
> Priority: Trivial
>
> Our house style does not specify whether/when imports are to be converted to stars. I propose that imports should be converted to stars if there are more than 3 from the same package. Thus:
> {code}
> import a.b.C1;
> import a.b.C2;
> import a.b.C3;
> {code}
> becomes
> {code}
> import a.b.*;
> {code}
> when {{a.b.C4}} is added. This is consistent with IntelliJ's default rule.
> It is OK to use stars if there are 3 or fewer uses. Thus removing the use of {{a.b.C2}} would not require imports to be changed.
> Checkstyle has a rule to ban star imports (excluding certain packages) but does not allow them to be limited to a particular number.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Re: [jira] [Commented] (OPTIQ-306) Standardize code style for "import package.*;"
Posted by Jacques Nadeau <ja...@apache.org>.
Agreed, brutal...
On Sun, Jul 6, 2014 at 12:27 PM, Julian Hyde <ju...@hydromatic.net> wrote:
> Vladimir, For what it's worth, I read through your discussions on the
> checkstyle list. I feel your pain. I too was intending to commit some minor
> improvements to checkstyle, but I've changed my mind. Please slap me if I
> ever speak to would-be committers the way you were spoken to on that list!
>
> Julian
>
>
Re: [jira] [Commented] (OPTIQ-306) Standardize code style for "import package.*;"
Posted by Julian Hyde <ju...@hydromatic.net>.
Vladimir, For what it's worth, I read through your discussions on the checkstyle list. I feel your pain. I too was intending to commit some minor improvements to checkstyle, but I've changed my mind. Please slap me if I ever speak to would-be committers the way you were spoken to on that list!
Julian