[
https://issues.apache.org/jira/browse/NIFI-2074?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Pierre Villard updated NIFI-2074:
---------------------------------
Attachment: checkstyle_eclipse.txt
Just had a look.
Eclipse oriented:
{code:xml}
<property name="customImportOrderRules"
value="STATIC###STANDARD_JAVA_PACKAGE###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE"/>
<property name="specialImportsRegExp" value="org"/>
<property name="thirdPartyPackageRegExp" value="com"/>
<property name="sortImportsInGroupAlphabetically" value="true"/>
<property name="separateLineBetweenGroups" value="true”/>
{code}
=> 6465 violations
IntelliJ oriented:
{code:xml}
<property name=“customImportOrderRules"
value="THIRD_PARTY_PACKAGE###SPECIAL_IMPORTS###STANDARD_JAVA_PACKAGE###STATIC"/>
<property name="specialImportsRegExp" value="^javax\."/>
<property name="standardPackageRegExp" value="^java\."/>
<property name="sortImportsInGroupAlphabetically" value="true"/>
<property name="separateLineBetweenGroups" value="false”/>
{code}
=> 11958 violations
Tried others variations but it seems the Eclipse one is the one that gives less
violations. I attached the report on the current master branch with the Eclipse
definition of imports.
Before going further and adopting one of the approach, I'd like to have
feedbacks ;-)
> Add checkstyle rule to normalize imports order
> ----------------------------------------------
>
> Key: NIFI-2074
> URL: https://issues.apache.org/jira/browse/NIFI-2074
> Project: Apache NiFi
> Issue Type: Improvement
> Components: Documentation & Website, Tools and Build
> Reporter: Pierre Villard
> Priority: Minor
> Labels: build, maven
> Attachments: checkstyle_eclipse.txt
>
>
> In order to avoid PR where imports order is uselessly modified because of the
> IDE formatter, it could be interesting to add a checkstyle rule to normalize
> the imports order so that when running -Pcontrib-check such a PR is not
> accepted.
> Since default formatting seems to be varying depending of the IDE, this
> should be documented
> (https://cwiki.apache.org/confluence/display/NIFI/Contributor+Guide#ContributorGuide-CodeStyle).
> Checkstyle options are documented here:
> http://checkstyle.sourceforge.net/config_imports.html#CustomImportOrder
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)