Skip to content
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

[clang-format] formatting of comment not stable; oscillates between two ways #106416

Open
joelhock opened this issue Aug 28, 2024 · 3 comments
Open
Labels
bug Indicates an unexpected problem or unintended behavior clang-format

Comments

@joelhock
Copy link

joelhock commented Aug 28, 2024

formatting oscillates between the two ways shown below each time it is reformatted with 19.1.0-rc3 and also main as of 114ff99. version 18 consistently chose the first one, fwiw.

.clang-format contents:

---
Language:        Cpp
IndentWidth:     4
MYMACRO(Val1,
        A, // a comment
           // a comment
        AA, // a comment
);

MYMACRO(Val1,
        A,  // a comment
            // a comment
        AA, // a comment
);
@owenca
Copy link
Contributor

owenca commented Aug 29, 2024

version 18 consistently chose the first one, fwiw.

Which version of 18?

@joelhock
Copy link
Author

greatest apologies! this is not a regression; it has been this way since at least version 8 (the farthest back binary i have).

@owenca owenca added bug Indicates an unexpected problem or unintended behavior and removed regression labels Aug 31, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Aug 31, 2024

@llvm/issue-subscribers-bug

Author: Joel Hock (joelhock)

formatting oscillates between the two ways shown below each time it is reformatted with 19.1.0-rc3 and also main as of 114ff99. version 18 consistently chose the first one, fwiw.

.clang-format contents:

---
Language:        Cpp
IndentWidth:     4
MYMACRO(Val1,
        A, // a comment
           // a comment
        AA, // a comment
);

MYMACRO(Val1,
        A,  // a comment
            // a comment
        AA, // a comment
);

@owenca owenca changed the title [clang-format] [regression] formatting of comment not stable; oscillates between two ways [clang-format] formatting of comment not stable; oscillates between two ways Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior clang-format
Projects
None yet
Development

No branches or pull requests

4 participants