Skip to content

clang-format-16 AlignTrailingComments: Kind: Leave moves comments #2 #59635

@MartinsSmirnovs

Description

@MartinsSmirnovs

Given following .clang-format file:

AlignTrailingComments:
  Kind: Leave

And following foo.cpp source file:

// Comment with trailing spaces in the end       
// Next comment

I expect that clang-format-16 foo.cpp will not perform formatting, however, it does:

$ clang-format-16 foo.cpp
// Comment with trailing spaces in the end
       // Next comment

clang-format-16 version:

$ clang-format-16 --version
Ubuntu clang-format version 16.0.0 (++20221221042320+05f343fa8afe-1~exp1~20221221042422.633)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions