簡體   English   中英

如何使用谷歌代碼風格制作CLion自動格式化C++代碼,並通過谷歌cpplint檢查

[英]How to make CLion auto format C++ code with Google code style, and pass the google cpplint check

我需要使用谷歌代碼樣式自動格式化我的 C++ 代碼,並通過 cpplint 檢查。

我已經在 CLion 中使用 + + L 自動格式化我的代碼,但格式化后的代碼仍然不遵循谷歌代碼風格。

而且我安裝了CLion-cpplint插件,這個插件只告訴我哪里不符合風格。 但我需要一個工具來自動格式化它。

謝謝。

  1. 在項目的根目錄中創建名為.clang-format的文件和行BasedOnStyle: Google inside
  2. 打開 ClangFormat 作為默認格式化程序ClangFormat 作為默認格式化程序
  3. 在 Git 提交對話框中添加Reformat code操作<code>重新格式化代碼</code>動作

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM