[clang] [clang-format] Option to insert spaces before the closing `*/` (PR #162105)

via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 23 23:27:12 PST 2025


owenca wrote:

@Men-cotton please describe in the commit message what this new option is intended to solve. Not just an issue number.

> @owenca can you also take a look?

What I would do is to add a single `SpacesInBlockComment` option with the following values:
- `Always`
```
/* foo */

/* foo
bar */

/* foo
*/

/*
foo */
```

- `Never`
```
/*foo*/

/*foo
bar*/

/*foo
*/

/*
foo*/
```

- `Leave`

Comments ending in `=*/` (and also starting in `/**` or ending in `**/`?) should not be affected by this option.

https://github.com/llvm/llvm-project/pull/162105


More information about the cfe-commits mailing list