Skip to content

[clang-format] AlignAfterOpenBracket: BlockIndent not applied to control structures #79176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
flyx opened this issue Jan 23, 2024 · 1 comment · May be fixed by #108332
Open

[clang-format] AlignAfterOpenBracket: BlockIndent not applied to control structures #79176

flyx opened this issue Jan 23, 2024 · 1 comment · May be fixed by #108332

Comments

@flyx
Copy link

flyx commented Jan 23, 2024

The documentation says that AlignAfterOpenBracket

only applies to braced initializer lists (when Cpp11BracedListStyle is true) and parentheses.

However, when I set it to BlockIndent, it doesn't apply to control structures in C++ even though they use parentheses. Instead of the current result of clang-format:

for (int someIterationValueWithLongName = 1;
     someIterationValueWithLongName < 10;
     someIterationValueWithLongName++) {
    // ...
}

based on the documentation, I expected to get this:

for (
    int someIterationValueWithLongName = 1;
    someIterationValueWithLongName < 10;
    someIterationValueWithLongName++
) {
    // ...
}

Same goes for if and while.

@gedare
Copy link
Contributor

gedare commented Sep 11, 2024

This appears to be a duplicate of #67738

@gedare gedare linked a pull request Sep 12, 2024 that will close this issue
gedare added a commit to gedare/llvm-project that referenced this issue Sep 23, 2024
Introduce new options to allow for control of AlwaysBreak and
BlockIndent selectively for If conditional statements (as currently
supported), other conditional statements (for/while/switch), and
other statements.

Fixes llvm#67738.
Fixes llvm#79176.
Fixes llvm#80123.
gedare added a commit to gedare/llvm-project that referenced this issue Oct 18, 2024
Introduce new options to allow for control of AlwaysBreak and
BlockIndent selectively for If conditional statements (as currently
supported), other conditional statements (for/while/switch), and
other statements.

Fixes llvm#67738.
Fixes llvm#79176.
Fixes llvm#80123.
gedare added a commit to gedare/llvm-project that referenced this issue Dec 2, 2024
Introduce new options to allow for control of AlwaysBreak and
BlockIndent selectively for If conditional statements (as currently
supported), other conditional statements (for/while/switch), and
other statements.

Fixes llvm#67738.
Fixes llvm#79176.
Fixes llvm#80123.
gedare added a commit to gedare/llvm-project that referenced this issue Jan 28, 2025
Introduce new options to allow for control of AlwaysBreak and
BlockIndent selectively for If conditional statements (as currently
supported), other conditional statements (for/while/switch), and
other statements.

Fixes llvm#67738.
Fixes llvm#79176.
Fixes llvm#80123.
gedare added a commit to gedare/llvm-project that referenced this issue Jan 29, 2025
Introduce new options to allow for control of AlwaysBreak and
BlockIndent selectively for If conditional statements (as currently
supported), other conditional statements (for/while/switch), and
other statements.

Fixes llvm#67738.
Fixes llvm#79176.
Fixes llvm#80123.
gedare added a commit to gedare/llvm-project that referenced this issue Feb 9, 2025
Introduce new options to allow for control of AlwaysBreak and
BlockIndent selectively for If conditional statements (as currently
supported), other conditional statements (for/while/switch), and
other statements.

Fixes llvm#67738.
Fixes llvm#79176.
Fixes llvm#80123.
gedare added a commit to gedare/llvm-project that referenced this issue Apr 30, 2025
Introduce new style option to allow overriding the breaking after the
opening parenthesis for control statements (if/for/while/switch).

Fixes llvm#67738.
Fixes llvm#79176.
Fixes llvm#80123.
gedare added a commit to gedare/llvm-project that referenced this issue May 1, 2025
Introduce new style option to allow overriding the breaking after the
opening parenthesis for control statements (if/for/while/switch).

Fixes llvm#67738.
Fixes llvm#79176.
Fixes llvm#80123.
gedare added a commit to gedare/llvm-project that referenced this issue May 12, 2025
Introduce new options to allow for control of AlwaysBreak and
BlockIndent selectively for If conditional statements (as currently
supported), other conditional statements (for/while/switch), and
other statements.

Fixes llvm#67738.
Fixes llvm#79176.
Fixes llvm#80123.
gedare added a commit to gedare/llvm-project that referenced this issue May 22, 2025
Introduce new style option to allow overriding the breaking after the
opening parenthesis for control statements (if/for/while/switch).

Fixes llvm#67738.
Fixes llvm#79176.
Fixes llvm#80123.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants