0

我使用带有 style=Google 的 clang-format 来完成格式化工作。clang-format版本是 12.0.1。格式化代码如下:

class SearchDoneService : public DoneService {
 public:
  explicit SearchDoneService(const string &);

但我不习惯使用 2 个空格(IndentWidth:2)。所以我修改为IndentWidth:4. 现在格式化的代码是这样的:

class SearchDoneService : public DoneService {
   public:
    explicit SearchDoneService(const string &);

似乎关键字(,,,publicprivate总是protected与类的成员函数保持 1 个空间距离。但我习惯cpplint做静态检查。屏幕打印出这样的:

warning: public: should be indented +1 space inside class SearchDoneService

警告是根据谷歌规则:

公共,受保护和私人顺序的部分,每个缩进一个空格。

如果我想更改IdentWidth为 4,如何静音此警告。感谢任何帮助。

4

0 回答 0