[PATCH] D92257: [clang-format] Add option to control the space at the front of a line comment

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 13 06:02:33 PST 2020


HazardyKnusperkeks added a comment.

In D92257#2438928 <https://reviews.llvm.org/D92257#2438928>, @MyDeveloperDay wrote:

> Could we consider dropping the maximum?

While rewriting the tests with the unmodified clang-format I just confirmed that currently only the minimum of 1 is enforced, there is no maximum. I.e.

  //x
  int x;
  //   y
  int y;

will be formatted as

  // x
  int x;
  //   y
  int y;

So for what I want to do I can:

1. Enforce the Minimum (for LLVM Style 1)
2. Enforce an optional Maximum (but what if the Maximum is set to 0, what I want to do, given that the Minimum is 1?)
3. Stay with the current design of a Minimum/Maximum Pair with (practically unbounded Maximum)

I would choose #3, in that case I only have to add a test for line comment sections (and most likely adapt the implementation).

  /// A List:
  ///  * Foo
  ///  * Bar


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92257/new/

https://reviews.llvm.org/D92257



More information about the cfe-commits mailing list