[PATCH] D87587: [clang-format][PR47290] Add ShortNamespaceLines format option

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 9 12:50:49 PST 2021


HazardyKnusperkeks added a comment.

Apart from my comments, this looks good to me and I really wonder why it hasn't been pushed. (I would directly use it!)



================
Comment at: clang/include/clang/Format/Format.h:2821
            MaxEmptyLinesToKeep == R.MaxEmptyLinesToKeep &&
+           ShortNamespaceLines == R.ShortNamespaceLines &&
            NamespaceIndentation == R.NamespaceIndentation &&
----------------
Could you sort this one alphabetically?


================
Comment at: clang/lib/Format/Format.cpp:576
     IO.mapOptional("MaxEmptyLinesToKeep", Style.MaxEmptyLinesToKeep);
+    IO.mapOptional("ShortNamespaceLines", Style.ShortNamespaceLines);
     IO.mapOptional("NamespaceIndentation", Style.NamespaceIndentation);
----------------
Dito


================
Comment at: clang/lib/Format/Format.cpp:939
   LLVMStyle.MaxEmptyLinesToKeep = 1;
+  LLVMStyle.ShortNamespaceLines = 1;
   LLVMStyle.KeepEmptyLinesAtTheStartOfBlocks = true;
----------------
Dito


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87587



More information about the cfe-commits mailing list