繁体   English   中英

Clang格式未使用.clang格式的文件ubuntu(无错误)

[英]Clang-format not using .clang-format file ubuntu (no errors)

我的项目目录中有一个.clang-format ,其中包含我的.cpp文件和生成目录。 从终端,我进入我的项目文件夹并运行clang-format -style=file -i *.cpp 这是我的.clang-format文件。

Language: Cpp
ColumnLimit: 0
BreakBeforeBraces: GNU
BreakConstructorInitializers: AfterColon
Cpp11BracedListStyle: true
IndentCaseLabels: true
NamespaceIndentation: All
IndentWidth: 4
TabWidth: 4
UseTab: Never
DerivePointerAlignment: false
PointerAlignment: Left
IncludeBlocks: Regroup

我通过更改BreakBeforeBraces测试功能,没有任何变化。 似乎正在使用后备格式。 这是怎么回事? 有没有办法查看clang-format实际上在做什么?

使用-style=file ,每个输入文件的clang格式将尝试查找位于输入文件最近的父目录中的.clang格式文件。 使用标准输入时,将从当前目录开始搜索。

您可以使用以下命令查看运行目录中使用的实际配置

clang-format -style=file -dump-config

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM