Codestyle Import ordering with the new version of IntelliJ 2018.3

已回答

The previous version of IntelliJ for Java we could specify the order of Java imports.  For example, import static all other imports, java, <blank line>, javax <blank line> org.*.* <blank line> "import all other imports".  

 

This match our checkstyle.xml

checkstyle.xml (Snippet)

<module name="ImportOrder">

<property name=severity" value="warning"/>

<property name=groups" value="java,javax/> 

<!-- This ensure that static imports go first. -->

<property name="option" value="top"/>

<property name="tokens" value="STATIC_IMPORT, IMPORT"/>

</module>

 

So, I could just use Control-Alt-O.  and run ./gradle :OurService:checkstyleMain and it will all pass, but not it fails the build with a "Checkstyle violation".

0

Please provide an isolated sample file and IDE code style profile you are using for format. Also describe the expected/actual result you get.

0

请先登录再写评论。