[clang] 6cd0015 - [clang-format][docs] Fix incorrect 'clang-format 14' option markers

via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 5 20:33:07 PST 2022


Author: Krystian Kuzniarek
Date: 2022-02-05T20:04:39-08:00
New Revision: 6cd0015e7827dd429844a18b7c8306e1d98044e4

URL: https://github.com/llvm/llvm-project/commit/6cd0015e7827dd429844a18b7c8306e1d98044e4
DIFF: https://github.com/llvm/llvm-project/commit/6cd0015e7827dd429844a18b7c8306e1d98044e4.diff

LOG: [clang-format][docs] Fix incorrect 'clang-format 14' option markers

Introduced by 23a5090c6, some style option markers indicated 'clang-format 14',
though their respective options were available in earlier releases.

Note: Even though the value type of 'SpacesInAngles' option changed,
this option has been already present since version 3.4.

Differential Revision: https://reviews.llvm.org/D118991

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 bc1c2944c3961..d610c19faf2b6 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -2209,7 +2209,7 @@ the configuration (without a prefix: ``Auto``).
 **DisableFormat** (``Boolean``) :versionbadge:`clang-format 3.7`
   Disables formatting completely.
 
-**EmptyLineAfterAccessModifier** (``EmptyLineAfterAccessModifierStyle``) :versionbadge:`clang-format 14`
+**EmptyLineAfterAccessModifier** (``EmptyLineAfterAccessModifierStyle``) :versionbadge:`clang-format 13`
   Defines when to put an empty line after access modifiers.
   ``EmptyLineBeforeAccessModifier`` configuration handles the number of
   empty lines between two access modifiers.
@@ -2375,7 +2375,7 @@ the configuration (without a prefix: ``Auto``).
 
   For example: BOOST_FOREACH.
 
-**IfMacros** (``List of Strings``) :versionbadge:`clang-format 14`
+**IfMacros** (``List of Strings``) :versionbadge:`clang-format 13`
   A vector of macros that should be interpreted as conditionals
   instead of as function calls.
 
@@ -3127,7 +3127,7 @@ the configuration (without a prefix: ``Auto``).
   Add a space in front of an Objective-C protocol list, i.e. use
   ``Foo <Protocol>`` instead of ``Foo<Protocol>``.
 
-**PPIndentWidth** (``Integer``) :versionbadge:`clang-format 14`
+**PPIndentWidth** (``Integer``) :versionbadge:`clang-format 13`
   The number of columns to use for indentation of preprocessor statements.
   When set to -1 (default) ``IndentWidth`` is used also for preprocessor
   statements.
@@ -3371,7 +3371,7 @@ the configuration (without a prefix: ``Auto``).
           BasedOnStyle: llvm
           CanonicalDelimiter: 'cc'
 
-**ReferenceAlignment** (``ReferenceAlignmentStyle``) :versionbadge:`clang-format 14`
+**ReferenceAlignment** (``ReferenceAlignmentStyle``) :versionbadge:`clang-format 13`
   Reference alignment style (overrides ``PointerAlignment`` for
   references).
 
@@ -3535,7 +3535,7 @@ the configuration (without a prefix: ``Auto``).
 
 
 
-**ShortNamespaceLines** (``Unsigned``) :versionbadge:`clang-format 14`
+**ShortNamespaceLines** (``Unsigned``) :versionbadge:`clang-format 13`
   The maximal number of unwrapped lines that a short namespace spans.
   Defaults to 1.
 
@@ -3969,7 +3969,7 @@ the configuration (without a prefix: ``Auto``).
        }             // foo
      }
 
-**SpacesInAngles** (``SpacesInAnglesStyle``) :versionbadge:`clang-format 14`
+**SpacesInAngles** (``SpacesInAnglesStyle``) :versionbadge:`clang-format 3.4`
   The SpacesInAnglesStyle to use for template argument lists.
 
   Possible values:
@@ -4024,7 +4024,7 @@ the configuration (without a prefix: ``Auto``).
      var arr = [ 1, 2, 3 ];         vs.     var arr = [1, 2, 3];
      f({a : 1, b : 2, c : 3});              f({a: 1, b: 2, c: 3});
 
-**SpacesInLineCommentPrefix** (``SpacesInLineComment``) :versionbadge:`clang-format 14`
+**SpacesInLineCommentPrefix** (``SpacesInLineComment``) :versionbadge:`clang-format 13`
   How many spaces are allowed at the start of a line comment. To disable the
   maximum set it to ``-1``, apart from that the maximum takes precedence
   over the minimum.

diff  --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h
index 326e85305c8e7..ee90a64f04df0 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -2110,7 +2110,7 @@ struct FormatStyle {
   /// Defines when to put an empty line after access modifiers.
   /// ``EmptyLineBeforeAccessModifier`` configuration handles the number of
   /// empty lines between two access modifiers.
-  /// \version 14
+  /// \version 13
   EmptyLineAfterAccessModifierStyle EmptyLineAfterAccessModifier;
 
   /// Different styles for empty line before access modifiers.
@@ -2285,7 +2285,7 @@ struct FormatStyle {
   ///
   /// For example: `KJ_IF_MAYBE
   /// <https://github.com/capnproto/capnproto/blob/master/kjdoc/tour.md#maybes>`_
-  /// \version 14
+  /// \version 13
   std::vector<std::string> IfMacros;
 
   /// \brief A vector of macros that should be interpreted as type declarations
@@ -2956,7 +2956,7 @@ struct FormatStyle {
   ///    # define BAR
   ///    #endif
   /// \endcode
-  /// \version 14
+  /// \version 13
   int PPIndentWidth;
 
   /// See documentation of ``RawStringFormats``.
@@ -3042,7 +3042,7 @@ struct FormatStyle {
 
   /// \brief Reference alignment style (overrides ``PointerAlignment`` for
   /// references).
-  /// \version 14
+  /// \version 13
   ReferenceAlignmentStyle ReferenceAlignment;
 
   // clang-format off
@@ -3193,7 +3193,7 @@ struct FormatStyle {
   ///      int bar;                           int bar;
   ///    } // namespace b                   } // namespace b
   /// \endcode
-  /// \version 14
+  /// \version 13
   unsigned ShortNamespaceLines;
 
   /// Include sorting options.
@@ -3610,7 +3610,7 @@ struct FormatStyle {
     SIAS_Leave
   };
   /// The SpacesInAnglesStyle to use for template argument lists.
-  /// \version 14
+  /// \version 3.4
   SpacesInAnglesStyle SpacesInAngles;
 
   /// If ``true``, spaces will be inserted around if/for/switch/while
@@ -3678,7 +3678,7 @@ struct FormatStyle {
   ///   ///  - Foo                                /// - Foo
   ///   ///    - Bar                              ///   - Bar
   /// \endcode
-  /// \version 14
+  /// \version 13
   SpacesInLineComment SpacesInLineCommentPrefix;
 
   /// If ``true``, spaces will be inserted after ``(`` and before ``)``.


        


More information about the cfe-commits mailing list