llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.24k stars 11.66k forks source link

[clang-format] AlignArrayOfStructures does not respect other flags #55154

Open tiagomacarios opened 2 years ago

tiagomacarios commented 2 years ago

With this clang-format config:

AlignArrayOfStructures: Left
IndentWidth: 4
SpaceBeforeCpp11BracedList: true
TabWidth: 4
UseTab: ForContinuationAndIndentation

I would expect the following formatting:

static type arr[] = {
    { fun(arg), arg },
    { fun(arg), arg },
    { fun(arg), arg },
    { fun(arg), arg },
    { fun(arg), arg },
    { fun(arg), arg },
    { fun(arg), arg },
};

note: code above use tabs

This is what I see instead:

static type arr[] = {
    {fun(arg), arg},
    {fun(arg), arg},
    {fun(arg), arg},
    {fun(arg), arg},
    {fun(arg), arg},
    {fun(arg), arg},
    {fun(arg), arg},
};

note: there is a mix of tabs and spaces

llvmbot commented 2 years ago

@llvm/issue-subscribers-clang-format