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:
While ordering the imports using Eclipse in the above projects, I have
found only one subtle mismatch between Eclipse and checkstyle: Here
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]
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/...
>>
>> 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(a)lists.jboss.org
>>
https://lists.jboss.org/mailman/listinfo/hawkular-dev
>>
>
> _______________________________________________
> hawkular-dev mailing list
> hawkular-dev(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/hawkular-dev
>
_______________________________________________
hawkular-dev mailing list
hawkular-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hawkular-dev