[clang] 51dbda5 - [clang-format][docfix] Update predefined styles in docs
Jake Merdich via cfe-commits
cfe-commits at lists.llvm.org
Wed May 20 17:05:58 PDT 2020
Author: Jake Merdich
Date: 2020-05-20T20:03:53-04:00
New Revision: 51dbda54384827533dcfcb712f918cee7acc3185
URL: https://github.com/llvm/llvm-project/commit/51dbda54384827533dcfcb712f918cee7acc3185
DIFF: https://github.com/llvm/llvm-project/commit/51dbda54384827533dcfcb712f918cee7acc3185.diff
LOG: [clang-format][docfix] Update predefined styles in docs
Summary:
The predefined styles that clang-format supports are listed in two
places, and neither is up-to-date. GNU style isn't mentioned at all!
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D80309
Added:
Modified:
clang/docs/ClangFormatStyleOptions.rst
clang/docs/LibFormat.rst
Removed:
################################################################################
diff --git a/clang/docs/ClangFormatStyleOptions.rst b/clang/docs/ClangFormatStyleOptions.rst
index 2afa17973454..496e4c651921 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -151,6 +151,9 @@ the configuration (without a prefix: ``Auto``).
* ``Microsoft``
A style complying with `Microsoft's style guide
<https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017>`_
+ * ``GNU``
+ A style complying with the `GNU coding standards
+ <https://www.gnu.org/prep/standards/standards.html>`_
.. START_FORMAT_STYLE_OPTIONS
diff --git a/clang/docs/LibFormat.rst b/clang/docs/LibFormat.rst
index 889fbbac8c7a..4ea84e658d1b 100644
--- a/clang/docs/LibFormat.rst
+++ b/clang/docs/LibFormat.rst
@@ -40,7 +40,7 @@ Style Options
The style options describe specific formatting options that can be used in
order to make `ClangFormat` comply with
diff erent style guides. Currently,
-two style guides are hard-coded:
+several style guides are hard-coded:
.. code-block:: c++
@@ -52,6 +52,26 @@ two style guides are hard-coded:
/// http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml.
FormatStyle getGoogleStyle();
+ /// Returns a format style complying with Chromium's style guide:
+ /// https://chromium.googlesource.com/chromium/src/+/master/styleguide/styleguide.md
+ FormatStyle getChromiumStyle();
+
+ /// Returns a format style complying with the GNU coding standards:
+ /// https://www.gnu.org/prep/standards/standards.html
+ FormatStyle getGNUStyle();
+
+ /// Returns a format style complying with Mozilla's style guide
+ /// https://firefox-source-docs.mozilla.org/code-quality/coding-style/index.html
+ FormatStyle getMozillaStyle();
+
+ /// Returns a format style complying with Webkit's style guide:
+ /// https://webkit.org/code-style-guidelines/
+ FormatStyle getWebkitStyle();
+
+ /// Returns a format style complying with Microsoft's style guide:
+ /// https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
+ FormatStyle getMicrosoftStyle();
+
These options are also exposed in the :doc:`standalone tools <ClangFormat>`
through the `-style` option.
More information about the cfe-commits
mailing list