[Hawkular-dev] Import order

Jiri Kremser jkremser at redhat.com
Tue Aug 4 10:38:46 EDT 2015


Hi,
  I believe, I've fixed it for the idea here [1]

[1]: https://github.com/hawkular/hawkular-build-tools/pull/22

The PR contains also a change that expands the settings.jar into normal files so that we can keep track of the changes in git (and build them back into settings.jar).

The little drawback is that you can't simply go and download the jar.. it could be done by some travis magic (which can push the jar into other branch after every build via github api). I'll leave this part on somebody else :]

cheers,
jk


----- Original Message -----
| From: "Peter Palaga" <ppalaga at redhat.com>
| To: hawkular-dev at lists.jboss.org
| Sent: Tuesday, 4 August, 2015 8:53:24 AM
| Subject: Re: [Hawkular-dev] Import order
| 
| Ordering of imports seems to be broken in some way in Idea:
| https://youtrack.jetbrains.com/issue/IDEA-142468
| 
| Idea users, could you please come up with a proposal, what to do in this
| situation?
| 
| Not introducing the Checkstyle rule will probably lead to gradual
| eroding of imports in all classes, also in those which are sorted
| properly ATM. That would be a pity.
| 
| Idea users, you are not ready to sort imports manually, I guess?
| 
| What else can be done? - Downgrade? Upvote the Idea bug?
| 
| Thanks,
| 
| Peter
| 
| On 2015-08-03 14:56, Peter Palaga wrote:
| > Status update: There is a PR [1] open in build tools to introduce the
| > Import order Checkstyle rule with the next version of HK Parent.
| >
| > Please protest loudly if you disagree.
| >
| > I have sent PRs fixing the import order to some components repos:
| > Hawkular: https://github.com/hawkular/hawkular/pull/384
| > Alerts: https://github.com/hawkular/hawkular-alerts/pull/79
| > Metrics: https://github.com/hawkular/hawkular-metrics/pull/296
| > Inventory: https://github.com/hawkular/hawkular-inventory/pull/135
| >
| > While ordering the imports using Eclipse in the above projects, I have
| > found only one subtle mismatch between Eclipse and checkstyle: Here
| > https://github.com/hawkular/hawkular-metrics/blob/2062a0a63e3d4a9eb22f77a79e082324d3b166a1/core/metrics-core-api/src/test/java/org/hawkular/metrics/core/api/IntervalTest.java#L19-L22
| >
| > Eclipse wants
| >
| > import static org.hawkular.metrics.core.api.Interval.parse;
| > import static org.hawkular.metrics.core.api.Interval.Units.DAYS;
| > import static org.hawkular.metrics.core.api.Interval.Units.HOURS;
| > import static org.hawkular.metrics.core.api.Interval.Units.MINUTES;
| >
| > While Checkstyle wants
| >
| > import static org.hawkular.metrics.core.api.Interval.Units.DAYS;
| > import static org.hawkular.metrics.core.api.Interval.Units.HOURS;
| > import static org.hawkular.metrics.core.api.Interval.Units.MINUTES;
| > import static org.hawkular.metrics.core.api.Interval.parse;
| >
| > There was just one occurrence of this problem and I hope that we can
| > neglect it.
| >
| > Thanks,
| >
| > Peter
| >
| > [1] https://github.com/hawkular/hawkular-build-tools/pull/21
| >
| > On 2015-06-17 09:11, Peter Palaga wrote:
| >> OK, I'll add the import order check to checkstyle.
| >> https://issues.jboss.org/browse/HAWKULAR-358 -- P
| >>
| >> On 16/06/15 12:14, Thomas Segismont wrote:
| >>> Le 16/06/2015 11:50, Peter Palaga a écrit :
| >>>> Hi Mazz,
| >>>>
| >>>> While I can remember some basic discussion about the order Java imports,
| >>>> I do not remember at all what was the result.
| >>>>
| >>>> I saw that you added Eclipse prefs for import order to dev tools which
| >>>> is definitely good
| >>>> https://github.com/hawkular/hawkular-build-tools/blob/master/ide-configs/eclipse/hawkular-eclipse-preferences-java-codestyle-organizeimports.importorder
| >>>>
| >>>> Do Idea prefs contain the same settings?
| >>>
| >>> Yes, they were built by Lucas and reviewed by me.
| >>>
| >>>>
| >>>> Are there projects using these settings consequently?
| >>>
| >>> All projects _should_ be using the same.
| >>>
| >>>>
| >>>> But did we say we would enforce the imports order by checkstyle?
| >>>
| >>> We didn't talk about that.
| >>>
| >>> I have recently commented on GitHub that import order was the only thing
| >>> not checked yet, and we keep on seeing PR with many lines of import
| >>> order differences.
| >>>
| >>> To me, it shows that formatting rules, if not enforced, are not
| >>> naturally observed.
| >>>
| >>>> They have a rule for that:
| >>>> http://checkstyle.sourceforge.net/config_imports.html#ImportOrder
| >>>
| >>> +1 for adding
| >>>
| >>>>
| >>>> Its a pity that we have not done it earlier.
| >>>>
| >>>> Thanks,
| >>>>
| >>>> Peter
| >>>> _______________________________________________
| >>>> hawkular-dev mailing list
| >>>> hawkular-dev at lists.jboss.org
| >>>> https://lists.jboss.org/mailman/listinfo/hawkular-dev
| >>>>
| >>>
| >>> _______________________________________________
| >>> hawkular-dev mailing list
| >>> hawkular-dev at lists.jboss.org
| >>> https://lists.jboss.org/mailman/listinfo/hawkular-dev
| >>>
| >>
| >> _______________________________________________
| >> hawkular-dev mailing list
| >> hawkular-dev at lists.jboss.org
| >> https://lists.jboss.org/mailman/listinfo/hawkular-dev
| >>
| >
| > _______________________________________________
| > hawkular-dev mailing list
| > hawkular-dev at lists.jboss.org
| > https://lists.jboss.org/mailman/listinfo/hawkular-dev
| >
| 
| _______________________________________________
| hawkular-dev mailing list
| hawkular-dev at lists.jboss.org
| https://lists.jboss.org/mailman/listinfo/hawkular-dev
|



More information about the hawkular-dev mailing list