[PATCH] D30405: [clang-format] Add a new flag FixNamespaceEndComments to FormatStyle

Daniel Jasper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 1 03:08:39 PST 2017


djasper added inline comments.


================
Comment at: include/clang/Format/Format.h:354
+  /// fixes invalid existing ones.
+  bool FixNamespaceEndComments;
+
----------------
To be consistent with the clang-tidy check, just call this "FixNamespaceComments".

After a change like this, you need to call docs/tools/dump_format_style.py in order to update the documentation.


================
Comment at: lib/Format/Format.cpp:1837
 
+  if (Style.Language == FormatStyle::LK_Cpp &&
+      Style.FixNamespaceEndComments) {
----------------
So much code copied and pasted. Could you pull out a method or lambda and call this with either the JavaScriptRequoter or the NamespaceEndCommentsFixer?

Also, at some point, we'll probably want to call several of these fixers in series. But we can leave that problem for another day.


https://reviews.llvm.org/D30405





More information about the cfe-commits mailing list