[PATCH] D84103: [clang-format] Make sure rst documentation matches comments

Anders Waldenborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 18 08:53:43 PDT 2020


wanders created this revision.
wanders added reviewers: MyDeveloperDay, JakeMerdichAMD.
wanders added a project: clang-format.
Herald added a project: clang.

  clang/docs/tools/dump_format_style.py is used to read the comments
  from clang/include/clang/Format/Format.h and update the contents of
  clang/docs/ClangFormatStyleOptions.rst
  
  Recent changes made these out of date. This commit syncs them by
  folding the improved wording back to the comments and then
  regenerating the rst file.

https://github.com/wanders/llvm-project/commit/148dd6d805a3429fef4973a5fb0a217b2ffeda32


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84103

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h


Index: clang/include/clang/Format/Format.h
===================================================================
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -1425,15 +1425,20 @@
   /// For example: TESTSUITE
   std::vector<std::string> NamespaceMacros;
 
-  /// A vector of macros which are whitespace-sensitive and shouldn't be
-  /// touched.
+  /// A vector of macros which are whitespace-sensitive and should not
+  /// be touched.
   ///
   /// These are expected to be macros of the form:
   /// \code
   ///   STRINGIZE(...)
   /// \endcode
   ///
-  /// For example: STRINGIZE
+  /// In the .clang-format configuration file, this can be configured like:
+  /// \code{.yaml}
+  ///   WhitespaceSensitiveMacros: ['STRINGIZE', 'PP_STRINGIZE']
+  /// \endcode
+  ///
+  /// For example: BOOST_PP_STRINGIZE
   std::vector<std::string> WhitespaceSensitiveMacros;
 
   tooling::IncludeStyle IncludeStyle;
Index: clang/docs/ClangFormatStyleOptions.rst
===================================================================
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -2694,8 +2694,11 @@
     Use tabs whenever we need to fill whitespace that spans at least from
     one tab stop to the next one.
 
+
+
 **WhitespaceSensitiveMacros** (``std::vector<std::string>``)
-  A vector of macros which are whitespace-sensitive and should not be touched.
+  A vector of macros which are whitespace-sensitive and should not
+  be touched.
 
   These are expected to be macros of the form:
 
@@ -2709,9 +2712,7 @@
 
     WhitespaceSensitiveMacros: ['STRINGIZE', 'PP_STRINGIZE']
 
-  For example: BOOST_PP_STRINGIZE.
-
-
+  For example: BOOST_PP_STRINGIZE
 
 .. END_FORMAT_STYLE_OPTIONS
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84103.279007.patch
Type: text/x-patch
Size: 1755 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200718/9e5df4f6/attachment.bin>


More information about the cfe-commits mailing list