[clang] 6d7ec54 - [clang-format] Make sure rst documentation matches comments
Anders Waldenborg via cfe-commits
cfe-commits at lists.llvm.org
Sat Jul 18 09:03:23 PDT 2020
Author: Anders Waldenborg
Date: 2020-07-18T18:02:14+02:00
New Revision: 6d7ec54170f9ef68710f484299caa1a6dd42ff48
URL: https://github.com/llvm/llvm-project/commit/6d7ec54170f9ef68710f484299caa1a6dd42ff48
DIFF: https://github.com/llvm/llvm-project/commit/6d7ec54170f9ef68710f484299caa1a6dd42ff48.diff
LOG: [clang-format] Make sure rst documentation matches comments
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.
Differential Revision: https://reviews.llvm.org/D84103
Added:
Modified:
clang/docs/ClangFormatStyleOptions.rst
clang/include/clang/Format/Format.h
Removed:
################################################################################
diff --git a/clang/docs/ClangFormatStyleOptions.rst b/clang/docs/ClangFormatStyleOptions.rst
index e84676760c30..6647b117ac59 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -2694,8 +2694,11 @@ the configuration (without a prefix: ``Auto``).
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 @@ the configuration (without a prefix: ``Auto``).
WhitespaceSensitiveMacros: ['STRINGIZE', 'PP_STRINGIZE']
- For example: BOOST_PP_STRINGIZE.
-
-
+ For example: BOOST_PP_STRINGIZE
.. END_FORMAT_STYLE_OPTIONS
diff --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h
index 3549ec9eee0e..7201c11f1158 100755
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -1425,15 +1425,20 @@ struct FormatStyle {
/// 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;
More information about the cfe-commits
mailing list