1. 程式人生 > >intelij IDEA設定goole code style風格

intelij IDEA設定goole code style風格

1.安裝google-java-format 外掛 
    file ->Setings... ->pligins
    輸入上訴外掛安裝
2.下載IntelliJ Java Google Style file檔案
    檔案已經掛在本人部落格,https://download.csdn.net/download/banana1006034246/10785007
    或者官網https://github.com/google/styleguide/blob/gh-pages/intellij-java-google-style.xml


    複製貼上命名為intellij-java-google-style.xml,在IDEA中設定
    file-> editor->code style 點選右窗體裡scheme後面的設定圖示,選擇import scheme找到你的xml檔案,之後按提示確定就行

問題:
遇到錯誤 intellij idea code style xml import failed with error message null 
原因:xml裡面含有空行,這種情況常常出現在使用 linux 的wget命令下載官方xml檔案導致

參考文獻

google java code style 中文版
https://github.com/google/google-java-format