[PATCH] D48827: [clang-format ]Extend IncludeCategories regex documentation

2018-07-25 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL337899: [clang-format ]Extend IncludeCategories regex 
documentation (authored by krasimir, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D48827?vs=154176=157213#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D48827

Files:
  cfe/trunk/docs/ClangFormatStyleOptions.rst
  cfe/trunk/docs/tools/dump_format_style.py
  cfe/trunk/include/clang/Format/Format.h
  cfe/trunk/include/clang/Tooling/Inclusions/IncludeStyle.h


Index: cfe/trunk/docs/ClangFormatStyleOptions.rst
===
--- cfe/trunk/docs/ClangFormatStyleOptions.rst
+++ cfe/trunk/docs/ClangFormatStyleOptions.rst
@@ -1280,6 +1280,10 @@
   Regular expressions denoting the different ``#include`` categories
   used for ordering ``#includes``.
 
+  `POSIX extended
+  `_
+  regular expressions are supported.
+
   These regular expressions are matched against the filename of an include
   (including the <> or "") in order. The value belonging to the first
   matching regular expression is assigned and ``#includes`` are sorted first
@@ -1302,6 +1306,8 @@
 Priority:2
   - Regex:   '^(<|"(gtest|gmock|isl|json)/)'
 Priority:3
+  - Regex:   '<[[:alnum:].]+>'
+Priority:4
   - Regex:   '.*'
 Priority:1
 
Index: cfe/trunk/docs/tools/dump_format_style.py
===
--- cfe/trunk/docs/tools/dump_format_style.py
+++ cfe/trunk/docs/tools/dump_format_style.py
@@ -10,6 +10,7 @@
 
 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 @@
   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 @@
   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))
Index: cfe/trunk/include/clang/Tooling/Inclusions/IncludeStyle.h
===
--- cfe/trunk/include/clang/Tooling/Inclusions/IncludeStyle.h
+++ cfe/trunk/include/clang/Tooling/Inclusions/IncludeStyle.h
@@ -67,6 +67,10 @@
   /// Regular expressions denoting the different ``#include`` categories
   /// used for ordering ``#includes``.
   ///
+  /// `POSIX extended
+  /// 
`_
+  /// regular expressions are supported.
+  ///
   /// These regular expressions are matched against the filename of an include
   /// (including the <> or "") in order. The value belonging to the first
   /// matching regular expression is assigned and ``#includes`` are sorted 
first
@@ -87,6 +91,8 @@
   ///   Priority:2
   /// - Regex:   '^(<|"(gtest|gmock|isl|json)/)'
   ///   Priority:3
+  /// - Regex:   '<[[:alnum:].]+>'
+  ///   Priority:4
   /// - Regex:   '.*'
   ///   Priority:1
   /// \endcode
Index: cfe/trunk/include/clang/Format/Format.h
===
--- cfe/trunk/include/clang/Format/Format.h
+++ cfe/trunk/include/clang/Format/Format.h
@@ -1296,7 +1296,7 @@
   /// If ``Never``, lays out Objective-C protocol conformance list items
   /// onto individual lines whenever they go over ``ColumnLimit``.
   ///
-  /// \code
+  /// \code{.objc}
   ///Always (or Auto, if BinPackParameters=true):
   ///@interface c () <
   ///c, c,


Index: cfe/trunk/docs/ClangFormatStyleOptions.rst
===
--- cfe/trunk/docs/ClangFormatStyleOptions.rst
+++ cfe/trunk/docs/ClangFormatStyleOptions.rst
@@ -1280,6 +1280,10 @@
   Regular expressions denoting the different ``#include`` categories
   used for ordering ``#includes``.
 
+  `POSIX extended
+  `_
+  regular expressions are supported.
+
   These regular expressions are matched against the filename of an include
   (including the <> or "") in order. The value belonging to the first
   matching regular expression is assigned and ``#includes`` 

[PATCH] D48827: [clang-format ]Extend IncludeCategories regex documentation

2018-07-25 Thread Wim Leflere via Phabricator via cfe-commits
WimLeflere added a comment.

I don't have commit access, can someone else commit this change?


Repository:
  rC Clang

https://reviews.llvm.org/D48827



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D48827: [clang-format ]Extend IncludeCategories regex documentation

2018-07-06 Thread Wim Leflere via Phabricator via cfe-commits
WimLeflere added a comment.

Who can merge these changes?
Or does this happen automatically?


Repository:
  rC Clang

https://reviews.llvm.org/D48827



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D48827: [clang-format ]Extend IncludeCategories regex documentation

2018-07-05 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision.
krasimir added a comment.
This revision is now accepted and ready to land.

Thank you!


Repository:
  rC Clang

https://reviews.llvm.org/D48827



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D48827: [clang-format ]Extend IncludeCategories regex documentation

2018-07-05 Thread Wim Leflere via Phabricator via cfe-commits
WimLeflere updated this revision to Diff 154176.
WimLeflere added a comment.

Added the documentation to the header file.
Also had to update dump_format_style.py because it was not loading the 
IncludeStyle header file.


Repository:
  rC Clang

https://reviews.llvm.org/D48827

Files:
  docs/ClangFormatStyleOptions.rst
  docs/tools/dump_format_style.py
  include/clang/Format/Format.h
  include/clang/Tooling/Inclusions/IncludeStyle.h


Index: include/clang/Tooling/Inclusions/IncludeStyle.h
===
--- include/clang/Tooling/Inclusions/IncludeStyle.h
+++ include/clang/Tooling/Inclusions/IncludeStyle.h
@@ -67,6 +67,10 @@
   /// Regular expressions denoting the different ``#include`` categories
   /// used for ordering ``#includes``.
   ///
+  /// `POSIX extended
+  /// 
`_
+  /// regular expressions are supported.
+  ///
   /// These regular expressions are matched against the filename of an include
   /// (including the <> or "") in order. The value belonging to the first
   /// matching regular expression is assigned and ``#includes`` are sorted 
first
@@ -87,6 +91,8 @@
   ///   Priority:2
   /// - Regex:   '^(<|"(gtest|gmock|isl|json)/)'
   ///   Priority:3
+  /// - Regex:   '<[[:alnum:].]+>'
+  ///   Priority:4
   /// - Regex:   '.*'
   ///   Priority:1
   /// \endcode
Index: include/clang/Format/Format.h
===
--- include/clang/Format/Format.h
+++ include/clang/Format/Format.h
@@ -1296,7 +1296,7 @@
   /// If ``Never``, lays out Objective-C protocol conformance list items
   /// onto individual lines whenever they go over ``ColumnLimit``.
   ///
-  /// \code
+  /// \code{.objc}
   ///Always (or Auto, if BinPackParameters=true):
   ///@interface c () <
   ///c, c,
Index: docs/tools/dump_format_style.py
===
--- docs/tools/dump_format_style.py
+++ docs/tools/dump_format_style.py
@@ -10,6 +10,7 @@
 
 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 @@
   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 @@
   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))
Index: docs/ClangFormatStyleOptions.rst
===
--- docs/ClangFormatStyleOptions.rst
+++ docs/ClangFormatStyleOptions.rst
@@ -1280,6 +1280,10 @@
   Regular expressions denoting the different ``#include`` categories
   used for ordering ``#includes``.
 
+  `POSIX extended
+  `_
+  regular expressions are supported.
+
   These regular expressions are matched against the filename of an include
   (including the <> or "") in order. The value belonging to the first
   matching regular expression is assigned and ``#includes`` are sorted first
@@ -1302,6 +1306,8 @@
 Priority:2
   - Regex:   '^(<|"(gtest|gmock|isl|json)/)'
 Priority:3
+  - Regex:   '<[[:alnum:].]+>'
+Priority:4
   - Regex:   '.*'
 Priority:1
 


Index: include/clang/Tooling/Inclusions/IncludeStyle.h
===
--- include/clang/Tooling/Inclusions/IncludeStyle.h
+++ include/clang/Tooling/Inclusions/IncludeStyle.h
@@ -67,6 +67,10 @@
   /// Regular expressions denoting the different ``#include`` categories
   /// used for ordering ``#includes``.
   ///
+  /// `POSIX extended
+  /// `_
+  /// regular expressions are supported.
+  ///
   /// These regular expressions are matched against the filename of an include
   /// (including the <> or "") in order. The value belonging to the first
   /// matching regular expression is assigned and ``#includes`` are sorted first
@@ -87,6 +91,8 @@
   ///   Priority:2
   /// - Regex:   '^(<|"(gtest|gmock|isl|json)/)'
   ///   Priority:3
+  /// - Regex:   '<[[:alnum:].]+>'
+ 

[PATCH] D48827: [clang-format ]Extend IncludeCategories regex documentation

2018-07-03 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir requested changes to this revision.
krasimir added a comment.
This revision now requires changes to proceed.

This file is automatically generated from `Format.h` using 
`clang/docs/tools/dump_format_style.py`. Please update.


Repository:
  rC Clang

https://reviews.llvm.org/D48827



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D48827: [clang-format ]Extend IncludeCategories regex documentation

2018-07-02 Thread Wim Leflere via Phabricator via cfe-commits
WimLeflere created this revision.
WimLeflere added reviewers: krasimir, Typz.
Herald added a subscriber: cfe-commits.

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.
bug 35041 


Repository:
  rC Clang

https://reviews.llvm.org/D48827

Files:
  docs/ClangFormatStyleOptions.rst


Index: docs/ClangFormatStyleOptions.rst
===
--- docs/ClangFormatStyleOptions.rst
+++ docs/ClangFormatStyleOptions.rst
@@ -1279,6 +1279,10 @@
 **IncludeCategories** (``std::vector``)
   Regular expressions denoting the different ``#include`` categories
   used for ordering ``#includes``.
+  
+  `POSIX extended
+  `_
+  regular expressions are supported.
 
   These regular expressions are matched against the filename of an include
   (including the <> or "") in order. The value belonging to the first
@@ -1302,6 +1306,8 @@
 Priority:2
   - Regex:   '^(<|"(gtest|gmock|isl|json)/)'
 Priority:3
+  - Regex:   '<[[:alnum:].]+>'
+Priority:4
   - Regex:   '.*'
 Priority:1
 


Index: docs/ClangFormatStyleOptions.rst
===
--- docs/ClangFormatStyleOptions.rst
+++ docs/ClangFormatStyleOptions.rst
@@ -1279,6 +1279,10 @@
 **IncludeCategories** (``std::vector``)
   Regular expressions denoting the different ``#include`` categories
   used for ordering ``#includes``.
+  
+  `POSIX extended
+  `_
+  regular expressions are supported.
 
   These regular expressions are matched against the filename of an include
   (including the <> or "") in order. The value belonging to the first
@@ -1302,6 +1306,8 @@
 Priority:2
   - Regex:   '^(<|"(gtest|gmock|isl|json)/)'
 Priority:3
+  - Regex:   '<[[:alnum:].]+>'
+Priority:4
   - Regex:   '.*'
 Priority:1
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits