【问题标题】:clang-format still formatting with `DisableFormat: true`clang-format 仍然使用 `DisableFormat: true` 进行格式化
【发布时间】:2019-04-24 15:37:58
【问题描述】:

正如documentation 所说:

DisableFormat (bool):完全禁用格式化。

但在.clang-format 中只有此选项的情况下检查源C++ 文件仍会报告该文件需要格式化。

【问题讨论】:

    标签: clang-format


    【解决方案1】:

    显然(至少对于clang-format 8.0DisableFormat: true 不会覆盖SortIncludes 选项,因此它也需要明确指定。在.clang-format 中包含以下内容将完全禁用格式化:

    DisableFormat: true
    SortIncludes: false
    

    更新

    还有一个 5.0 版的 issue report,到目前为止还没有引起任何关注。

    【讨论】:

      猜你喜欢
      • 2017-10-30
      • 1970-01-01
      • 2019-06-18
      • 2020-08-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-17
      相关资源
      最近更新 更多