Hi, Thank you for sharing the solution, Xiangwei!
There is just one thing to note, the correct imports layout should be as follows: import org.apache.iotdb.* <blank line> import all other imports <blank line> import java.* <blank line> import static all other imports Best, Steve Su ------------------ ???????? ------------------ ??????: "dev" <[email protected]>; ????????: 2021??2??25??(??????) ????9:55 ??????: "dev"<[email protected]>;"Steve Su"<[email protected]>; ????: Re: [ANNOUNCE] The Spotless with google-java-format now in effect Hi, I tried to configure it in a new computer without code style file. Unfortunately, it merged java packages with *. Then I imported the code style file again, and again, the order of import file was incorrect. Thanks the help of @Steve Su <[email protected]> I found the solution of this problem. Search code style in preferences -> choose Java -> choose Imports -> choose Imports Layout below -> Then modify the order of imports like: import all other imports <blank line> import java.* <blank line> import static all other imports I hope it helps if you encounter the same problem. jincheng sun <[email protected]> ??2021??2??24?????? ????9:38?????? > Thanks for the feedback XiangWei! > > Just like Xiangdong said, we do not need download the code style file just > import from our project is enough. > I'd like to know if the plug-in works well to you now? > > Best, > Jincheng Sun ?????? > > > Xiangdong Huang <[email protected]> ??2021??2??23?????? ????12:03?????? > > > > The import ordering is not handled by this plugin > > > > Really? On my IDEA, it works. > > I did not set the step: "download the IntelliJ Java Google Style file and > > import it into File??Settings??Editor??Code Style" > > > > Best, > > ----------------------------------- > > Xiangdong Huang > > School of Software, Tsinghua University > > > > ?????? > > ???????? ???????? > > > > > > Xiangwei Wei <[email protected]> ??2021??2??22?????? ????4:13?????? > > > > > Hi Jincheng, > > > > > > > > > I followed the user guide in [1], installed the google-java-format > plugin > > > and Save Actions plugin. But it seems the import ordering is not > handled > > > properly. > > > In the site of google-java-format [2], the problem is mentioned: > > > > > > "The import ordering is not handled by this plugin, unfortunately. > > > To fix the import order, download the IntelliJ Java Google Style file > and > > > import it into File??Settings??Editor??Code Style." > > > > > > I did like this, but it was not working. Do you have some solutions? > > > > > > Thank you. Regards > > > > > > > > > [1] > > > > http://iotdb.apache.org/Development/ContributeGuide.html#code-formatting > > > [2] > > > > > > > > > https://github.com/google/google-java-format#intellij-android-studio-and-other-jetbrains-ides > > > > > > > > > jincheng sun <[email protected]> ??2021??2??19?????? ????9:46?????? > > > > > > > It seems that step 7 should be performed first to ensure that the > > commit > > > > for step 2 is there. > > > > > > > > jincheng sun <[email protected]> ??2021??2??18?????? > > > > ????8:57?????? > > > > > > > > > Hi folks, > > > > > > > > > > We have merged the PRs of IOTDB-1156, i.e., the Spotless with > > > > > google-java-format now in effect. > > > > > > > > > > This change touched most of single java file in the > repository(70K+). > > > So > > > > > most of PRs will require a rebase, follow the steps below: > > > > > > > > > > 1. git checkout YOUR_PR > > > > > 2. git cherry-pick b1261ecb5893ee0d357fec311b4d92ff9039a989 > > > > > 3. mvn spotless:check > > > > > 4. mvn spotless:apply > > > > > 5. git add . > > > > > 6. git commit -m 'Apply Spotless' > > > > > > > > > > # asf [email protected]:apache/iotdb.git (fetch) > > > > > # Pull the latest master branch > > > > > > > > > > 7. git checkout -b asf_master asf/master > > > > > 8. git checkout YOUR_PR > > > > > 9. git rebase asf_master > > > > > > > > > > # Resolve your conflict: > > > > > # NOTE: `Accept Yours` for your PR involves files, and `accept > > Theirs` > > > > for > > > > > other files. > > > > > > > > > > 10 git rebase --continue > > > > > # Double check > > > > > 11. mvn spotless:check > > > > > # If you see "build success" successfully, it is proved that rebase > > has > > > > > been successful. > > > > > 12. mvn clean package -DskipTests > > > > > # If you see "build success" successfully, you can push your > changes > > to > > > > > you PR branch. > > > > > > > > > > Then you can squash the commits if you want, Good luck! > > > > > > > > > > Most of the changes were done by the commit(70fc76de8b5a032), which > > you > > > > > can exclude from git blame by configuring git as follows: > > > > > > > > > > git config blame.ignoreRevsFile .git-blame-ignore-revs > > > > > > > > > > You can setup the IDE to follow the new code style according [1] > > > > > > > > > > Finally, a big thank you to Xiangdong and Dawei for review and > merge > > > PR, > > > > > and the people who involved in the early discussions.[2] > > > > > > > > > > Best, > > > > > Jincheng ?????? > > > > > > > > > > [1] > > > > > > > > > > > > > > > https://iotdb.apache.org/Development/ContributeGuide.html#code-formatting > > > > > [2] > > > > > > > > > > > > > > > https://lists.apache.org/thread.html/rd07d66cc819bce546aced54d7f0b0ab4552a910a120f05fe900915dc%40%3Cdev.iotdb.apache.org%3E > > > > > > > > > > > > > > > > > > -- > > > Best, > > > Xiangwei Wei > > > > > > -- Best, Xiangwei Wei
