[PATCH] D121451: [clang-format] Add space to comments starting with '#'.

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 21 01:40:04 PDT 2022


krasimir added a comment.

This appears to have broken a relatively common pattern we see in text proto comments where sections use a style like this:

  ################################################################################
  # Big section name
  ################################################################################

After this patch, this gets broken up (in text protos we recognize up to 4 #-s as a comment leader: https://github.com/llvm/llvm-project/blob/e725e2afe02e18398525652c9bceda1eb055ea64/clang/lib/Format/BreakableToken.cpp#L46):

  #### ############################################################################
  # Big section name
  #### ############################################################################

IMO, this is analogous to, e.g., using many `/`s in C++ source, which clang-format leaves alone.

  //////////////////////
  // section name
  //////////////////////

I'll be happy to work on a fix and add a regression test; wanted to this with you first. Also, do we now still develop clang-format's patches & discuss here first, or over at github via PRs?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121451



More information about the cfe-commits mailing list