From cf699ad9ab458ed94de8a4e772534ff4a23c8933 Mon Sep 17 00:00:00 2001 From: Krasimir Georgiev Date: Wed, 25 Jul 2018 10:21:47 +0000 Subject: [clang-format ]Extend IncludeCategories regex documentation Summary: Extend the Clang-Format IncludeCategories documentation by adding a link to the supported regular expression standard (POSIX). And extenting the example with a system header regex. [[ https://bugs.llvm.org/show_bug.cgi?id=35041 | bug 35041]] Contributed by WimLeflere! Reviewers: krasimir, Typz Reviewed By: krasimir Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D48827 llvm-svn: 337899 --- clang/docs/tools/dump_format_style.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/docs/tools') diff --git a/clang/docs/tools/dump_format_style.py b/clang/docs/tools/dump_format_style.py index 1ca050e062b..3d61227f736 100755 --- a/clang/docs/tools/dump_format_style.py +++ b/clang/docs/tools/dump_format_style.py @@ -10,6 +10,7 @@ import urllib2 CLANG_DIR = os.path.join(os.path.dirname(__file__), '../..') FORMAT_STYLE_FILE = os.path.join(CLANG_DIR, 'include/clang/Format/Format.h') +INCLUDE_STYLE_FILE = os.path.join(CLANG_DIR, 'include/clang/Tooling/Inclusions/IncludeStyle.h') DOC_FILE = os.path.join(CLANG_DIR, 'docs/ClangFormatStyleOptions.rst') @@ -115,7 +116,7 @@ def read_options(header): for line in header: line = line.strip() if state == State.BeforeStruct: - if line == 'struct FormatStyle {': + if line == 'struct FormatStyle {' or line == 'struct IncludeStyle {': state = State.InStruct elif state == State.InStruct: if line.startswith('///'): @@ -188,6 +189,7 @@ def read_options(header): return options options = read_options(open(FORMAT_STYLE_FILE)) +options += read_options(open(INCLUDE_STYLE_FILE)) options = sorted(options, key=lambda x: x.name) options_text = '\n\n'.join(map(str, options)) -- cgit v1.2.3