[
https://issues.apache.org/jira/browse/NIFI-15420?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18050185#comment-18050185
]
ASF subversion and git services commented on NIFI-15420:
--------------------------------------------------------
Commit 5e8f7c53b1b23de00de40f42602dfdb3b69d8bcf in nifi's branch
refs/heads/main from Pierre Villard
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=5e8f7c53b1 ]
NIFI-15420 Added Checkstyle rule for import ordering (#10725)
Signed-off-by: David Handermann <[email protected]>
> Add checkstyle rule for import ordering
> ---------------------------------------
>
> Key: NIFI-15420
> URL: https://issues.apache.org/jira/browse/NIFI-15420
> Project: Apache NiFi
> Issue Type: Task
> Components: Tools and Build
> Reporter: Pierre Villard
> Assignee: Pierre Villard
> Priority: Major
> Time Spent: 20m
> Remaining Estimate: 0h
>
> While this requires a large number of changes, this will put us in a much
> better position going forward avoiding PRs where imports may have been
> automatically re-ordered because of the IDE settings.
> I checked many possible configurations to find something that is both
> useful/legit and not raising a crazy number of violations (this config is
> about 11k violations, when the Google Style rule is 30k+ violations).
> I'm suggesting this rule:
> {code:xml}
> <module name="CustomImportOrder">
> <property name="customImportOrderRules"
> value="THIRD_PARTY_PACKAGE###SPECIAL_IMPORTS###STANDARD_JAVA_PACKAGE###STATIC"/>
> <property name="sortImportsInGroupAlphabetically" value="true"/>
> <property name="separateLineBetweenGroups" value="true"/>
> <property name="standardPackageRegExp" value="^(java|javax)\."/>
> </module>{code}
> And I am also using a maven plugin to help with most of the work (it still
> needs small manual updates after that)
> {code:java}
> mvn net.revelc.code:impsort-maven-plugin:1.12.0:sort \
> -Dimpsort.staticGroups='*' \
> -Dimpsort.groups='*,java.,javax.' \
> -Dimpsort.staticAfter=true \
> -DskipTests=true {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)