【问题标题】:Is there a way to call clang-format on every .cpp and .h file in a solution?有没有办法在解决方案中对每个 .cpp 和 .h 文件调用 clang-format?
【发布时间】:2017-04-07 15:02:02
【问题描述】:

我已经尝试过the Visual Studio plugin,但您必须选择要应用 clang 的代码,然后调用格式化程序。所以 CTRL+A CTRL+R CTRL+F 对于每个文件。

有没有办法为整个项目和/或整个解决方案做到这一点,而无需手动检查每个文件?

【问题讨论】:

    标签: visual-studio clang-format


    【解决方案1】:

    我不知道如何通过引用 Visual Studio 项目来做到这一点,但这应该可以通过从命令行调用 clang-format 来格式化文件夹中的所有内容:

    clang-format style=llvm *.h *.cpp

    更多信息here

    【讨论】:

      猜你喜欢
      • 2019-09-27
      • 2016-02-23
      • 2023-04-03
      • 2020-09-16
      • 1970-01-01
      • 2021-02-24
      • 1970-01-01
      • 2021-06-07
      • 2017-03-15
      相关资源
      最近更新 更多