[PATCH] D122064: [clang-format][docs] Fix incorrect 'clang-format 11' option markers

2022-03-29 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

Hi. Could you deliver this, please?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122064/new/

https://reviews.llvm.org/D122064

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


[PATCH] D122064: [clang-format][docs] Fix incorrect 'clang-format 11' option markers

2022-04-05 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

Kind reminder, please deliver this revision. I don't have write access.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122064/new/

https://reviews.llvm.org/D122064

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


[PATCH] D120631: [clang-format][docs] Fix incorrect 'clang-format 12' option markers

2022-03-10 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.
Herald added a project: All.

Kind reminder, please deliver this one for me.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120631/new/

https://reviews.llvm.org/D120631

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


[PATCH] D121749: [clang-format][docs] Regenerate ClangFormatStyleOptions.rst

2022-03-15 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry created this revision.
kuzkry added reviewers: sstwcw, MyDeveloperDay.
kuzkry added a project: clang-format.
Herald added a project: All.
kuzkry requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Misalignment of clang/docs/ClangFormatStyleOptions.rst and
clang/include/clang/Format/Format.h was introduced in c24b3db45 
.

Regenerated with:
python clang/docs/tools/dump_format_style.py


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121749

Files:
  clang/docs/ClangFormatStyleOptions.rst

Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -358,8 +358,8 @@
   /* A comment. */
   double e = 4;
 
-  * ``bool AlignCompound`` Only for ``AlignConsecutiveAssignments``.  Whether compound
-assignments like ``+=`` are aligned along with ``=``.
+  * ``bool AlignCompound`` Only for ``AlignConsecutiveAssignments``.  Whether compound assignments
+like ``+=`` are aligned along with ``=``.
 
 .. code-block:: c++
 
@@ -371,10 +371,9 @@
   a &= 2;
   bbb = 2;
 
-  * ``bool PadOperators`` Only for ``AlignConsecutiveAssignments``.  Whether short
-assignment operators are left-padded to the same length as long
-ones in order to put all assignment operators to the right of
-the left hand side.
+  * ``bool PadOperators`` Only for ``AlignConsecutiveAssignments``.  Whether short assignment
+operators are left-padded to the same length as long ones in order to
+put all assignment operators to the right of the left hand side.
 
 .. code-block:: c++
 
@@ -482,8 +481,8 @@
   /* A comment. */
   double e = 4;
 
-  * ``bool AlignCompound`` Only for ``AlignConsecutiveAssignments``.  Whether compound
-assignments like ``+=`` are aligned along with ``=``.
+  * ``bool AlignCompound`` Only for ``AlignConsecutiveAssignments``.  Whether compound assignments
+like ``+=`` are aligned along with ``=``.
 
 .. code-block:: c++
 
@@ -495,10 +494,9 @@
   a &= 2;
   bbb = 2;
 
-  * ``bool PadOperators`` Only for ``AlignConsecutiveAssignments``.  Whether short
-assignment operators are left-padded to the same length as long
-ones in order to put all assignment operators to the right of
-the left hand side.
+  * ``bool PadOperators`` Only for ``AlignConsecutiveAssignments``.  Whether short assignment
+operators are left-padded to the same length as long ones in order to
+put all assignment operators to the right of the left hand side.
 
 .. code-block:: c++
 
@@ -606,8 +604,8 @@
   /* A comment. */
   double e = 4;
 
-  * ``bool AlignCompound`` Only for ``AlignConsecutiveAssignments``.  Whether compound
-assignments like ``+=`` are aligned along with ``=``.
+  * ``bool AlignCompound`` Only for ``AlignConsecutiveAssignments``.  Whether compound assignments
+like ``+=`` are aligned along with ``=``.
 
 .. code-block:: c++
 
@@ -619,10 +617,9 @@
   a &= 2;
   bbb = 2;
 
-  * ``bool PadOperators`` Only for ``AlignConsecutiveAssignments``.  Whether short
-assignment operators are left-padded to the same length as long
-ones in order to put all assignment operators to the right of
-the left hand side.
+  * ``bool PadOperators`` Only for ``AlignConsecutiveAssignments``.  Whether short assignment
+operators are left-padded to the same length as long ones in order to
+put all assignment operators to the right of the left hand side.
 
 .. code-block:: c++
 
@@ -731,8 +728,8 @@
   /* A comment. */
   double e = 4;
 
-  * ``bool AlignCompound`` Only for ``AlignConsecutiveAssignments``.  Whether compound
-assignments like ``+=`` are aligned along with ``=``.
+  * ``bool AlignCompound`` Only for ``AlignConsecutiveAssignments``.  Whether compound assignments
+like ``+=`` are aligned along with ``=``.
 
 .. code-block:: c++
 
@@ -744,10 +741,9 @@
   a &= 2;
   bbb = 2;
 
-  * ``bool PadOperators`` Only for ``AlignConsecutiveAssignments``.  Whether short
-assignment operators are left-padded to the same length as long
-ones in order to put all assignment operators to the right of
-the left hand side.
+  * ``bool PadOperators`` Only for ``AlignConsecutiveAssignments``.  Whether short assignment
+operators are left-padded to the same length as long ones in order to
+put all assignment operators to the right of the left hand side.
 
 .. code-block:: c++
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121749: [clang-format][docs] Regenerate ClangFormatStyleOptions.rst

2022-03-15 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

@sstwcw, I think you must have forgotten to regenerate the rst file :) I added 
you as a reviewer to this revision.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121749/new/

https://reviews.llvm.org/D121749

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


[PATCH] D121749: [clang-format][docs] Regenerate ClangFormatStyleOptions.rst

2022-03-17 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a subscriber: MyDeveloperDay.
kuzkry added a comment.

I removed @MyDeveloperDay, as this is a trivial PR and already got 3 approvals.

Anyway, could someone please deliver this one for me? My name and email in git 
format is "Krystian Kuzniarek "


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121749/new/

https://reviews.llvm.org/D121749

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


[PATCH] D121749: [clang-format][docs] Regenerate ClangFormatStyleOptions.rst

2022-03-17 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added inline comments.



Comment at: clang/docs/ClangFormatStyleOptions.rst:361
 
-  * ``bool AlignCompound`` Only for ``AlignConsecutiveAssignments``.  Whether 
compound
-assignments like ``+=`` are aligned along with ``=``.
+  * ``bool AlignCompound`` Only for ``AlignConsecutiveAssignments``.  Whether 
compound assignments
+like ``+=`` are aligned along with ``=``.

MyDeveloperDay wrote:
> owenpan wrote:
> > curdeius wrote:
> > > curdeius wrote:
> > > > sstwcw wrote:
> > > > > MyDeveloperDay wrote:
> > > > > > Is this wider than 80 chars?
> > > > > The comment in the source code is within 80 columns.  The python 
> > > > > script prepended the option name.  It's the same case as line 1541.
> > > > It is indeed. But it was already longer than 80 chars.
> > > > I'll have a look at the script to see how to fix this.
> > > At the same time, does it really matter if it's auto-generated?
> > It should not matter, especially because it’s also a non-source file.
> I seem to remember once before I made a change to clang-tidy and they liked 
> the rst to be no wider than 80 chars, but that might have been hand generated 
> rst.  If I remember rightly @Eugene.Zelenko picked me up on it, So I actually 
> developed a script (which never landed) that checks the rst for me.  {D55523}
> 
> I still use this from time to time and try and clean up.
> 
> ```
> Checking docs/ClangFormatStyleOptions.rst...
> warning: line 9 title and markup non matching lengths
> warning: line 21 multiple blank lines
> warning: line 35 maximize 80 characters by joining:'[When using 
> ``-style=file:``, :program:`clang-format` for]' and 
> '[each...]
> 
> warning: line 36 maximize 80 characters by joining:'[each input file will use 
> the format file located at ``.]' and '[The...]
> 
> warning: line 103 multiple blank lines
> warning: line 121 multiple blank lines
> warning: line 130 multiple blank lines
> warning: line 139 multiple blank lines
> warning: line 181 maximize 80 characters by 
> joining:'[**AccessModifierOffset** (``Integer``) :versionbadge:`clang-format 
> 3.3`]' and '[The...]
> 
> warning: line 184 is in excess of 80 characters (87) : 
> **AlignAfterOpenBracket** (``BracketAlignmentStyle``) 
> :versionbadge:`clang-format 3.8`
> ...
> warning: line 228 multiple blank lines
> warning: line 229 trailing whitespace
> warning: line 233 multiple blank lines
> warning: line 234 multiple blank lines
> warning: line 235 is in excess of 80 characters (96) : 
> **AlignArrayOfStructures** (``ArrayInitializerAlignmentStyle``) 
> :versionbadge:`clang-format 13`
> ...
> warning: line 236 maximize 80 characters by joining:'[  if not ``None``, when 
> using initialization for an array of structs]' and '[aligns...]
> 
> warning: line 251 contains double spaces
> warning: line 253 contains double spaces
> warning: line 263 contains double spaces
> warning: line 265 contains double spaces
> warning: line 271 multiple blank lines
> warning: line 272 multiple blank lines
> warning: line 273 is in excess of 80 characters (93) : 
> **AlignConsecutiveAssignments** (``AlignConsecutiveStyle``) 
> :versionbadge:`clang-format 3.8`
> ...
> warning: line 280 contains double spaces
> warning: line 282 contains double spaces
> warning: line 295 maximize 80 characters by joining:'[  For example, to align 
> across empty lines and not across comments, either]' and '[of...]
> 
> warning: line 311 contains double spaces
> warning: line 312 contains double spaces
> warning: line 314 contains double spaces
> warning: line 315 contains double spaces
> warning: line 317 contains double spaces
> warning: line 319 contains double spaces
> warning: line 322 contains double spaces
> warning: line 323 contains double spaces
> warning: line 325 contains double spaces
> warning: line 326 contains double spaces
> warning: line 334 contains double spaces
> warning: line 336 contains double spaces
> warning: line 338 contains double spaces
> warning: line 341 contains double spaces
> warning: line 343 contains double spaces
> warning: line 352 contains double spaces
> warning: line 361 contains double spaces
> warning: line 367 contains double spaces
> warning: line 368 contains double spaces
> warning: line 374 contains double spaces
> warning: line 381 contains double spaces
> warning: line 382 contains double spaces
> warning: line 384 contains double spaces
> warning: line 391 contains double spaces
> warning: line 394 multiple blank lines
> warning: line 395 is in excess of 80 characters (90) : 
> **AlignConsecutiveBitFields** (``AlignConsecutiveStyle``) 
> :versionbadge:`clang-format 11`
> ...
> warning: line 398 maximize 80 characters by joining:'[  ``Consecutive`` will 
> align the bitfield separators of consecutive lines.]' and '[This...]
> 
> warning: line 404 contains double spaces
> warning: line 405 contains double spaces
> warning: line 418 maximize 80 characters by joining:'[  For example, to align 
> across empty l

[PATCH] D122064: [clang-format][docs] Fix incorrect 'clang-format 11' option markers

2022-03-19 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry created this revision.
kuzkry added reviewers: MyDeveloperDay, HazardyKnusperkeks.
kuzkry added a project: clang-format.
Herald added a project: All.
kuzkry requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D122064

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h

Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -462,7 +462,7 @@
 
   /// Dependent on the value, ``while (true) { continue; }`` can be put on a
   /// single line.
-  /// \version 11
+  /// \version 3.5
   ShortBlockStyle AllowShortBlocksOnASingleLine;
 
   /// If ``true``, short case labels will be contracted to a single line.
@@ -1926,7 +1926,7 @@
 
   /// \brief Analyze the formatted file for the most used line ending (``\r\n``
   /// or ``\n``). ``UseCRLF`` is only used as a fallback if none can be derived.
-  /// \version 11
+  /// \version 10
   bool DeriveLineEnding;
 
   /// If ``true``, analyze the formatted file for the most common
@@ -3574,7 +3574,7 @@
   ///void f() { }   vs.   void f() {}
   ///while (true) { } while (true) {}
   /// \endcode
-  /// \version 11
+  /// \version 10
   bool SpaceInEmptyBlock;
 
   /// If ``true``, spaces may be inserted into ``()``.
@@ -3637,7 +3637,7 @@
   ///if ( a )  { ... }  vs. if (a) { ... }
   ///while ( i < 5 )  { ... }   while (i < 5) { ... }
   /// \endcode
-  /// \version 11
+  /// \version 10
   bool SpacesInConditionalStatement;
 
   /// If ``true``, spaces are inserted inside container literals (e.g.
@@ -3724,7 +3724,7 @@
   ///int a [5];vs.  int a[5];
   ///int a [5][5]; vs.  int a[5][5];
   /// \endcode
-  /// \version 11
+  /// \version 10
   bool SpaceBeforeSquareBrackets;
 
   /// Styles for adding spacing around ``:`` in bitfield definitions.
@@ -3831,7 +3831,7 @@
 
   /// \brief Use ``\r\n`` instead of ``\n`` for line breaks.
   /// Also used as fallback if ``DeriveLineEnding`` is true.
-  /// \version 11
+  /// \version 10
   bool UseCRLF;
 
   /// The way to use tab characters in the resulting file.
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -894,7 +894,7 @@
 int d,
 int e);
 
-**AllowShortBlocksOnASingleLine** (``ShortBlockStyle``) :versionbadge:`clang-format 11`
+**AllowShortBlocksOnASingleLine** (``ShortBlockStyle``) :versionbadge:`clang-format 3.5`
   Dependent on the value, ``while (true) { continue; }`` can be put on a
   single line.
 
@@ -2418,7 +2418,7 @@
  f(MyMap[{composite, key}]);f(MyMap[{ composite, key }]);
  new int[3]{1, 2, 3};   new int[3]{ 1, 2, 3 };
 
-**DeriveLineEnding** (``Boolean``) :versionbadge:`clang-format 11`
+**DeriveLineEnding** (``Boolean``) :versionbadge:`clang-format 10`
   Analyze the formatted file for the most used line ending (``\r\n``
   or ``\n``). ``UseCRLF`` is only used as a fallback if none can be derived.
 
@@ -4295,7 +4295,7 @@
  true:  false:
  for (auto v : values) {}   vs. for(auto v: values) {}
 
-**SpaceBeforeSquareBrackets** (``Boolean``) :versionbadge:`clang-format 11`
+**SpaceBeforeSquareBrackets** (``Boolean``) :versionbadge:`clang-format 10`
   If ``true``, spaces will be before  ``[``.
   Lambdas will not be affected. Only the first ``[`` will get a space added.
 
@@ -4305,7 +4305,7 @@
  int a [5];vs.  int a[5];
  int a [5][5]; vs.  int a[5][5];
 
-**SpaceInEmptyBlock** (``Boolean``) :versionbadge:`clang-format 11`
+**SpaceInEmptyBlock** (``Boolean``) :versionbadge:`clang-format 10`
   If ``true``, spaces will be inserted into ``{}``.
 
   .. code-block:: c++
@@ -4379,7 +4379,7 @@
  true:  false:
  x = ( int32 )y vs. x = (int32)y
 
-**SpacesInConditionalStatement** (``Boolean``) :versionbadge:`clang-format 11`
+**SpacesInConditionalStatement** (``Boolean``) :versionbadge:`clang-format 10`
   If ``true``, spaces will be inserted around if/for/switch/while
   conditions.
 
@@ -4543,7 +4543,7 @@
 
   For example: OpenSSL STACK_OF, BSD LIST_ENTRY.
 
-**UseCRLF** (``Boolean``) :versionbadge:`clang-format 11`
+**UseCRLF** (``Boolean``) :versionbadge:`clang-format 10`
   Use ``\r\n`` inste

[PATCH] D122064: [clang-format][docs] Fix incorrect 'clang-format 11' option markers

2022-03-19 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

Here's a list of earliest commits where each option changed in this PR was 
introduced:

AllowShortBlocksOnASingleLine - introduced by 
17605d396118f3066a0bd4dfd128b7a8893f8b94
DeriveLineEnding - introduced by 358eaa3dcea1dee6350c2cbf80aab3c25db4d4d9 

SpaceBeforeSquareBrackets - introduced by 
a4a7c1259e8a8f2d11fa29686a6c2834948c1358 

SpaceInEmptyBlock - introduced by db4ad3603ac9bc2f118aa5f176dc04979f836c25
SpacesInConditionalStatement - introduced by 
26748a321e20a7aa952ce8daa4f030c384ae7032 

UseCRLF - introduced by 358eaa3dcea1dee6350c2cbf80aab3c25db4d4d9 



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122064/new/

https://reviews.llvm.org/D122064

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


[PATCH] D122064: [clang-format][docs] Fix incorrect 'clang-format 11' option markers

2022-03-21 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

Thanks for the review. Could you please deliver this one for me? My name and 
email in git format is "Krystian Kuzniarek "


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122064/new/

https://reviews.llvm.org/D122064

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


[PATCH] D122064: [clang-format][docs] Fix incorrect 'clang-format 11' option markers

2022-04-07 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a subscriber: owenpan.
kuzkry added a comment.

@owenpan, thank you for delivery.

> You just could ask for push rights, especially if you want to change 
> something more in the future.

I will request it then. Hopefully I get accepted as apparently they check for a 
good "record of submitting high quality patches" (from 
https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122064/new/

https://reviews.llvm.org/D122064

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


[PATCH] D123299: [clang-format][docs] Fix incorrect 'clang-format 9' option marker

2022-04-07 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry created this revision.
kuzkry added reviewers: MyDeveloperDay, HazardyKnusperkeks.
kuzkry added a project: clang-format.
Herald added a project: All.
kuzkry requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Introduced by 23a5090c6 
, this 
style option marker indicated
'clang-format 9', though its respective option was available in
an earlier release.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D123299

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h


Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -600,7 +600,7 @@
   };
 
   /// Dependent on the value, ``if (a) return;`` can be put on a single line.
-  /// \version 9
+  /// \version 3.3
   ShortIfStyle AllowShortIfStatementsOnASingleLine;
 
   /// Different styles for merging short lambdas containing at most one
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -1019,7 +1019,7 @@
 
 
 
-**AllowShortIfStatementsOnASingleLine** (``ShortIfStyle``) 
:versionbadge:`clang-format 9`
+**AllowShortIfStatementsOnASingleLine** (``ShortIfStyle``) 
:versionbadge:`clang-format 3.3`
   Dependent on the value, ``if (a) return;`` can be put on a single line.
 
   Possible values:


Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -600,7 +600,7 @@
   };
 
   /// Dependent on the value, ``if (a) return;`` can be put on a single line.
-  /// \version 9
+  /// \version 3.3
   ShortIfStyle AllowShortIfStatementsOnASingleLine;
 
   /// Different styles for merging short lambdas containing at most one
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -1019,7 +1019,7 @@
 
 
 
-**AllowShortIfStatementsOnASingleLine** (``ShortIfStyle``) :versionbadge:`clang-format 9`
+**AllowShortIfStatementsOnASingleLine** (``ShortIfStyle``) :versionbadge:`clang-format 3.3`
   Dependent on the value, ``if (a) return;`` can be put on a single line.
 
   Possible values:
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D123299: [clang-format][docs] Fix incorrect 'clang-format 9' option marker

2022-04-07 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

Hi, I've got yet another one. Luckily, nothing wrong with clang-format 10, all 
were fine. This one was the only option incorrectly marked as clang-format 9.

Note, AllowShortIfStatementsOnASingleLine was introduced by 
1b750edda14879a16ce782b3ade3af599bfbb717


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123299/new/

https://reviews.llvm.org/D123299

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


[PATCH] D118991: [clang-format][docs] Fix incorrect 'clang-format 14' configuration options markers

2022-02-04 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry created this revision.
kuzkry added a reviewer: MyDeveloperDay.
kuzkry requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

[clang-format][docs] Fix incorrect 'clang-format 14' configuration options 
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 from version 3.4.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118991

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h

Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -2110,7 +2110,7 @@
   /// 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 @@
   ///
   /// For example: `KJ_IF_MAYBE
   /// `_
-  /// \version 14
+  /// \version 13
   std::vector IfMacros;
 
   /// \brief A vector of macros that should be interpreted as type declarations
@@ -2956,7 +2956,7 @@
   ///# define BAR
   ///#endif
   /// \endcode
-  /// \version 14
+  /// \version 13
   int PPIndentWidth;
 
   /// See documentation of ``RawStringFormats``.
@@ -3042,7 +3042,7 @@
 
   /// \brief Reference alignment style (overrides ``PointerAlignment`` for
   /// references).
-  /// \version 14
+  /// \version 13
   ReferenceAlignmentStyle ReferenceAlignment;
 
   // clang-format off
@@ -3193,7 +3193,7 @@
   ///  int bar;   int bar;
   ///} // namespace b   } // namespace b
   /// \endcode
-  /// \version 14
+  /// \version 13
   unsigned ShortNamespaceLines;
 
   /// Include sorting options.
@@ -3610,7 +3610,7 @@
 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 @@
   ///   ///  - Foo/// - Foo
   ///   ///- Bar  ///   - Bar
   /// \endcode
-  /// \version 14
+  /// \version 13
   SpacesInLineComment SpacesInLineCommentPrefix;
 
   /// If ``true``, spaces will be inserted after ``(`` and before ``)``.
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -2209,7 +2209,7 @@
 **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 @@
 
   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 @@
   Add a space in front of an Objective-C protocol list, i.e. use
   ``Foo `` instead of ``Foo``.
 
-**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 @@
   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 @@
 
 
 
-**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 @@
} // foo
  

[PATCH] D118991: [clang-format][docs] Fix incorrect 'clang-format 14' configuration options markers

2022-02-05 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

Hey @MyDeveloperDay,

Thank you for your positive feedback :)

You asked about my technique. Well, I did it empirically. There is a really 
splendid repository on GitHub by muttleyxd, i.e. 
https://github.com/muttleyxd/clang-tools-static-binaries. What muttleyxd did is 
he automated the task of compiling all major versions of clang tools (including 
clang-format) and he released it in form of static binaries to avoid problems 
with dependencies (they are really small though). Btw. I recommend you to at 
least save this as a bookmark in your web browser.

Having downloaded clang-format in versions 3.9 and from 4.0 to 13.0, I simply 
manually ran those binaries and looked for "unknown key" errors. I did that 
only for all options marked with "clang-format 14" tag, i.e.:
EmptyLineAfterAccessModifier
IfMacros
PPIndentWidth
PackConstructorInitializers
PenaltyBreakOpenParenthesis
QualifierAlignment
QualifierOrder
ReferenceAlignment
RemoveBracesLLVM
SeparateDefinitionBlocks
ShortNamespaceLines
SpaceBeforeParensOptions
SpacesInAngles
SpacesInLineCommentPrefix

The only problem I got was SpacesInAngles, which I actually checked using your 
technique, i.e. git-based rather than empirical one. I had to make it like that 
cause it was already available before 3.9, which is the earliest in muttleyxd's 
repository.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118991/new/

https://reviews.llvm.org/D118991

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


[PATCH] D118991: [clang-format][docs] Fix incorrect 'clang-format 14' configuration options markers

2022-02-05 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

In D118991#3298823 , @MyDeveloperDay 
wrote:

> Do you need someone to land this for you? if so we need your "name 
> "

Yes, I need someone to do that. Could you do this for me, please? It's 
"Krystian Kuzniarek ". Thanks in advance.

P.S. I plan to continue with similar work in decreasing order of clang-format 
versions so firstly for "clang-format 13", secondly for 12, then 11, etc. If I 
find some more inaccuracies, I will prepare new Phabricator reviews for you.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118991/new/

https://reviews.llvm.org/D118991

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


[PATCH] D119682: [clang-format][docs] Fix incorrect 'clang-format 13' configuration options markers

2022-02-13 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry created this revision.
kuzkry added a reviewer: MyDeveloperDay.
kuzkry requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Note: Option 'IndentRequiresClause' was previously known as
'IndentRequires' but the version marker should still indicate
'clang-format 15' as this option most recent name wasn't accessible
earlier and it would produce:
error: unknown key 'IndentRequiresClause'


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119682

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h


Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -1791,7 +1791,7 @@
   };
 
   /// The concept declaration style to use.
-  /// \version 13
+  /// \version 12
   BreakBeforeConceptDeclarationsStyle BreakBeforeConceptDeclarations;
 
   /// If ``true``, ternary operators will be placed after line breaks.
@@ -2185,7 +2185,7 @@
   };
 
   /// Defines in which cases to put empty line before access modifiers.
-  /// \version 13
+  /// \version 12
   EmptyLineBeforeAccessModifierStyle EmptyLineBeforeAccessModifier;
 
   /// If ``true``, clang-format detects whether function calls and
@@ -2538,7 +2538,7 @@
   ///  //
   ///}
   /// \endcode
-  /// \version 13
+  /// \version 15
   bool IndentRequiresClause;
 
   /// The number of columns to use for indentation.
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -1988,7 +1988,7 @@
 
 
 
-**BreakBeforeConceptDeclarations** (``BreakBeforeConceptDeclarationsStyle``) 
:versionbadge:`clang-format 13`
+**BreakBeforeConceptDeclarations** (``BreakBeforeConceptDeclarationsStyle``) 
:versionbadge:`clang-format 12`
   The concept declaration style to use.
 
   Possible values:
@@ -2278,7 +2278,7 @@
 
 
 
-**EmptyLineBeforeAccessModifier** (``EmptyLineBeforeAccessModifierStyle``) 
:versionbadge:`clang-format 13`
+**EmptyLineBeforeAccessModifier** (``EmptyLineBeforeAccessModifierStyle``) 
:versionbadge:`clang-format 12`
   Defines in which cases to put empty line before access modifiers.
 
   Possible values:
@@ -2706,7 +2706,7 @@
 
 
 
-**IndentRequiresClause** (``Boolean``) :versionbadge:`clang-format 13`
+**IndentRequiresClause** (``Boolean``) :versionbadge:`clang-format 15`
   Indent the requires clause in a template. This only applies when
   ``RequiresClausePosition`` is ``OwnLine``, or ``WithFollowing``.
 


Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -1791,7 +1791,7 @@
   };
 
   /// The concept declaration style to use.
-  /// \version 13
+  /// \version 12
   BreakBeforeConceptDeclarationsStyle BreakBeforeConceptDeclarations;
 
   /// If ``true``, ternary operators will be placed after line breaks.
@@ -2185,7 +2185,7 @@
   };
 
   /// Defines in which cases to put empty line before access modifiers.
-  /// \version 13
+  /// \version 12
   EmptyLineBeforeAccessModifierStyle EmptyLineBeforeAccessModifier;
 
   /// If ``true``, clang-format detects whether function calls and
@@ -2538,7 +2538,7 @@
   ///  //
   ///}
   /// \endcode
-  /// \version 13
+  /// \version 15
   bool IndentRequiresClause;
 
   /// The number of columns to use for indentation.
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -1988,7 +1988,7 @@
 
 
 
-**BreakBeforeConceptDeclarations** (``BreakBeforeConceptDeclarationsStyle``) :versionbadge:`clang-format 13`
+**BreakBeforeConceptDeclarations** (``BreakBeforeConceptDeclarationsStyle``) :versionbadge:`clang-format 12`
   The concept declaration style to use.
 
   Possible values:
@@ -2278,7 +2278,7 @@
 
 
 
-**EmptyLineBeforeAccessModifier** (``EmptyLineBeforeAccessModifierStyle``) :versionbadge:`clang-format 13`
+**EmptyLineBeforeAccessModifier** (``EmptyLineBeforeAccessModifierStyle``) :versionbadge:`clang-format 12`
   Defines in which cases to put empty line before access modifiers.
 
   Possible values:
@@ -2706,7 +2706,7 @@
 
 
 
-**IndentRequiresClause** (``Boolean``) :versionbadge:`clang-format 13`
+**IndentRequiresClause** (``Boolean``) :versionbadge:`clang-format 15`
   Indent the requires clause in a template. This only applies when
   ``RequiresClausePosition`` is ``OwnLine``, or ``WithFollowing``.
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D123299: [clang-format][docs] Fix incorrect 'clang-format 9' option marker

2022-04-26 Thread Krystian Kuzniarek via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG712b59cdc5a7: [clang-format][docs] Fix incorrect 
'clang-format 9' option marker (authored by kuzkry).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123299/new/

https://reviews.llvm.org/D123299

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h


Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -600,7 +600,7 @@
   };
 
   /// Dependent on the value, ``if (a) return;`` can be put on a single line.
-  /// \version 9
+  /// \version 3.3
   ShortIfStyle AllowShortIfStatementsOnASingleLine;
 
   /// Different styles for merging short lambdas containing at most one
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -1019,7 +1019,7 @@
 
 
 
-**AllowShortIfStatementsOnASingleLine** (``ShortIfStyle``) 
:versionbadge:`clang-format 9`
+**AllowShortIfStatementsOnASingleLine** (``ShortIfStyle``) 
:versionbadge:`clang-format 3.3`
   Dependent on the value, ``if (a) return;`` can be put on a single line.
 
   Possible values:


Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -600,7 +600,7 @@
   };
 
   /// Dependent on the value, ``if (a) return;`` can be put on a single line.
-  /// \version 9
+  /// \version 3.3
   ShortIfStyle AllowShortIfStatementsOnASingleLine;
 
   /// Different styles for merging short lambdas containing at most one
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -1019,7 +1019,7 @@
 
 
 
-**AllowShortIfStatementsOnASingleLine** (``ShortIfStyle``) :versionbadge:`clang-format 9`
+**AllowShortIfStatementsOnASingleLine** (``ShortIfStyle``) :versionbadge:`clang-format 3.3`
   Dependent on the value, ``if (a) return;`` can be put on a single line.
 
   Possible values:
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D124625: [clang-format][docs] Fix incorrect 'clang-format 7' option markers

2022-04-28 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry created this revision.
kuzkry added reviewers: MyDeveloperDay, HazardyKnusperkeks.
kuzkry added a project: clang-format.
Herald added a project: All.
kuzkry requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D124625

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

Index: clang/include/clang/Tooling/Inclusions/IncludeStyle.h
===
--- clang/include/clang/Tooling/Inclusions/IncludeStyle.h
+++ clang/include/clang/Tooling/Inclusions/IncludeStyle.h
@@ -50,7 +50,7 @@
 
   /// Dependent on the value, multiple ``#include`` blocks can be sorted
   /// as one and divided based on category.
-  /// \version 7
+  /// \version 6
   IncludeBlocksStyle IncludeBlocks;
 
   /// See documentation of ``IncludeCategories``.
@@ -114,7 +114,7 @@
   ///   Priority:1
   ///   SortPriority:0
   /// \endcode
-  /// \version 7
+  /// \version 3.8
   std::vector IncludeCategories;
 
   /// Specify a regular expression of suffixes that are allowed in the
@@ -128,7 +128,7 @@
   ///
   /// For example, if configured to "(_test)?$", then a header a.h would be seen
   /// as the "main" include in both a.cc and a_test.cc.
-  /// \version 7
+  /// \version 3.9
   std::string IncludeIsMainRegex;
 
   /// Specify a regular expression for files being formatted
@@ -149,7 +149,7 @@
   /// also being respected in later phase). Without this option set,
   /// ``ClassImpl.hpp`` would not have the main include file put on top
   /// before any other include.
-  /// \version 7
+  /// \version 10
   std::string IncludeIsMainSourceRegex;
 };
 
Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -786,7 +786,7 @@
   };
 
   /// The template declaration breaking style to use.
-  /// \version 7
+  /// \version 3.4
   BreakTemplateDeclarationsStyle AlwaysBreakTemplateDeclarations;
 
   /// A vector of strings that should be interpreted as attributes/qualifiers
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -1256,7 +1256,7 @@
  """";
  "";
 
-**AlwaysBreakTemplateDeclarations** (``BreakTemplateDeclarationsStyle``) :versionbadge:`clang-format 7`
+**AlwaysBreakTemplateDeclarations** (``BreakTemplateDeclarationsStyle``) :versionbadge:`clang-format 3.4`
   The template declaration breaking style to use.
 
   Possible values:
@@ -2623,7 +2623,7 @@
   For example: `KJ_IF_MAYBE
   `_
 
-**IncludeBlocks** (``IncludeBlocksStyle``) :versionbadge:`clang-format 7`
+**IncludeBlocks** (``IncludeBlocksStyle``) :versionbadge:`clang-format 6`
   Dependent on the value, multiple ``#include`` blocks can be sorted
   as one and divided based on category.
 
@@ -2663,7 +2663,7 @@
 
 
 
-**IncludeCategories** (``List of IncludeCategories``) :versionbadge:`clang-format 7`
+**IncludeCategories** (``List of IncludeCategories``) :versionbadge:`clang-format 3.8`
   Regular expressions denoting the different ``#include`` categories
   used for ordering ``#includes``.
 
@@ -2711,7 +2711,7 @@
 Priority:1
 SortPriority:0
 
-**IncludeIsMainRegex** (``String``) :versionbadge:`clang-format 7`
+**IncludeIsMainRegex** (``String``) :versionbadge:`clang-format 3.9`
   Specify a regular expression of suffixes that are allowed in the
   file-to-main-include mapping.
 
@@ -2724,7 +2724,7 @@
   For example, if configured to "(_test)?$", then a header a.h would be seen
   as the "main" include in both a.cc and a_test.cc.
 
-**IncludeIsMainSourceRegex** (``String``) :versionbadge:`clang-format 7`
+**IncludeIsMainSourceRegex** (``String``) :versionbadge:`clang-format 10`
   Specify a regular expression for files being formatted
   that are allowed to be considered "main" in the
   file-to-main-include mapping.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D124625: [clang-format][docs] Fix incorrect 'clang-format 7' option markers

2022-04-28 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

Here's a list of earliest commits where each option changed in this PR was 
introduced:

AlwaysBreakTemplateDeclarations - 61e6bbf8508a46ad1269c8ea67dc0372b84e9a3b
IncludeBlocks - 4c2c9c3620e3bed9cb6fa709ec3b3cc454eb5748
IncludeCategories - introduced in 85c472dccdf536fb1853139f456a0763311a8a42 and 
configurable from 8ce1b8df7690bc25788c7da1b464c654461489b0
IncludeIsMainRegex - 9c8ff3551ace965a3232fc4a1b53a75015a706cf
IncludeIsMainSourceRegex - 335ac2eb662ce5f1888e2a50310b01fba2d40d68 



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124625/new/

https://reviews.llvm.org/D124625

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


[PATCH] D124625: [clang-format][docs] Fix incorrect 'clang-format 7' option markers

2022-07-16 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

I forgot to add "Differential revision" footer to the commit message and so 
I've got to manually close this review. Sorry


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124625/new/

https://reviews.llvm.org/D124625

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


[PATCH] D129934: [clang-format][docs] Fix incorrect 'clang-format 4' option markers

2022-07-16 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry created this revision.
kuzkry added a reviewer: MyDeveloperDay.
kuzkry added a project: clang-format.
Herald added a project: All.
kuzkry requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D129934

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h


Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -2980,7 +2980,7 @@
   ////* second veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment 
with plenty of
   /// * information */
   /// \endcode
-  /// \version 4
+  /// \version 3.8
   bool ReflowComments;
   // clang-format on
 
@@ -3236,7 +3236,7 @@
   /// insensitive fashion.
   /// If ``CaseSensitive``, includes are sorted in an alphabetical or case
   /// sensitive fashion.
-  /// \version 4
+  /// \version 3.8
   SortIncludesOptions SortIncludes;
 
   /// Position for Java Static imports.
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -3670,7 +3670,7 @@
 
 
 
-**ReflowComments** (``Boolean``) :versionbadge:`clang-format 4`
+**ReflowComments** (``Boolean``) :versionbadge:`clang-format 3.8`
   If ``true``, clang-format will attempt to re-flow comments.
 
   .. code-block:: c++
@@ -3910,7 +3910,7 @@
int bar;   int bar;
  } // namespace b   } // namespace b
 
-**SortIncludes** (``SortIncludesOptions``) :versionbadge:`clang-format 4`
+**SortIncludes** (``SortIncludesOptions``) :versionbadge:`clang-format 3.8`
   Controls if and how clang-format will sort ``#includes``.
   If ``Never``, includes are never sorted.
   If ``CaseInsensitive``, includes are sorted in an ASCIIbetical or case


Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -2980,7 +2980,7 @@
   ////* second veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of
   /// * information */
   /// \endcode
-  /// \version 4
+  /// \version 3.8
   bool ReflowComments;
   // clang-format on
 
@@ -3236,7 +3236,7 @@
   /// insensitive fashion.
   /// If ``CaseSensitive``, includes are sorted in an alphabetical or case
   /// sensitive fashion.
-  /// \version 4
+  /// \version 3.8
   SortIncludesOptions SortIncludes;
 
   /// Position for Java Static imports.
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -3670,7 +3670,7 @@
 
 
 
-**ReflowComments** (``Boolean``) :versionbadge:`clang-format 4`
+**ReflowComments** (``Boolean``) :versionbadge:`clang-format 3.8`
   If ``true``, clang-format will attempt to re-flow comments.
 
   .. code-block:: c++
@@ -3910,7 +3910,7 @@
int bar;   int bar;
  } // namespace b   } // namespace b
 
-**SortIncludes** (``SortIncludesOptions``) :versionbadge:`clang-format 4`
+**SortIncludes** (``SortIncludesOptions``) :versionbadge:`clang-format 3.8`
   Controls if and how clang-format will sort ``#includes``.
   If ``Never``, includes are never sorted.
   If ``CaseInsensitive``, includes are sorted in an ASCIIbetical or case
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D129934: [clang-format][docs] Fix incorrect 'clang-format 4' option markers

2022-07-16 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

Hi! Here's a list of earliest commits where each option changed in this PR was 
introduced:

ReflowComments - a0a5039d2e520fd42646cb305ed8b696acb41e63
SortIncludes - da446770823be1b1d1562734e55da7c1a5f2579c


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129934/new/

https://reviews.llvm.org/D129934

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


[PATCH] D87587: [clang-format] Make one-line namespaces resistant to FixNamespaceComments, update documentation

2020-09-13 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry created this revision.
kuzkry added reviewers: krasimir, JakeMerdichAMD, jmerdich, rsmith.
kuzkry added a project: clang-format.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
kuzkry requested review of this revision.

clang-format documentation states that having enabled
FixNamespaceComments one may expect below code:

  c++
  namespace a {
  foo();
  }

to be turned into:

  c++
  namespace a {
  foo();
  } // namespace a

In reality, no "// namespace a" was added. The problem was too high
value of kShortNamespaceMaxLines, which is used while deciding whether
a namespace is long enough to be formatted.

As with 9163fe2, it remains to ensure clang-format is idempotent.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87587

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h
  clang/lib/Format/NamespaceEndCommentsFixer.cpp
  clang/unittests/Format/FormatTest.cpp
  clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp

Index: clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
===
--- clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
+++ clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
@@ -142,7 +142,7 @@
   EXPECT_EQ("namespace A {\n"
 "namespace B {\n"
 "int i;\n"
-"}\n"
+"}// namespace B\n"
 "}// namespace A",
 fixNamespaceEndComments("namespace A {\n"
 "namespace B {\n"
@@ -423,8 +423,9 @@
 TEST_F(NamespaceEndCommentsFixerTest, DoesNotAddEndCommentForShortNamespace) {
   EXPECT_EQ("namespace {}", fixNamespaceEndComments("namespace {}"));
   EXPECT_EQ("namespace A {}", fixNamespaceEndComments("namespace A {}"));
-  EXPECT_EQ("namespace A { a }", fixNamespaceEndComments("namespace A { a }"));
-  EXPECT_EQ("namespace A { a };",
+  EXPECT_EQ("namespace A { a }// namespace A",
+fixNamespaceEndComments("namespace A { a }"));
+  EXPECT_EQ("namespace A { a };// namespace A",
 fixNamespaceEndComments("namespace A { a };"));
 }
 
Index: clang/unittests/Format/FormatTest.cpp
===
--- clang/unittests/Format/FormatTest.cpp
+++ clang/unittests/Format/FormatTest.cpp
@@ -211,7 +211,7 @@
   EXPECT_EQ("namespace N {\n"
 "\n"
 "int i;\n"
-"}",
+"}  // namespace N",
 format("namespace N {\n"
"\n"
"inti;\n"
@@ -220,7 +220,7 @@
   EXPECT_EQ("/* something */ namespace N {\n"
 "\n"
 "int i;\n"
-"}",
+"}  // namespace N",
 format("/* something */ namespace N {\n"
"\n"
"inti;\n"
@@ -229,7 +229,7 @@
   EXPECT_EQ("inline namespace N {\n"
 "\n"
 "int i;\n"
-"}",
+"}  // namespace N",
 format("inline namespace N {\n"
"\n"
"inti;\n"
@@ -238,7 +238,7 @@
   EXPECT_EQ("/* something */ inline namespace N {\n"
 "\n"
 "int i;\n"
-"}",
+"}  // namespace N",
 format("/* something */ inline namespace N {\n"
"\n"
"inti;\n"
@@ -247,7 +247,7 @@
   EXPECT_EQ("export namespace N {\n"
 "\n"
 "int i;\n"
-"}",
+"}  // namespace N",
 format("export namespace N {\n"
"\n"
"inti;\n"
@@ -369,7 +369,7 @@
   EXPECT_EQ("namespace {\n"
 "int i;\n"
 "\n"
-"}",
+"} // namespace",
 format("namespace {\n"
"int i;\n"
"\n"
@@ -8887,7 +8887,7 @@
 format("void  f  (  )  {  if  ( a )  return  }"));
   EXPECT_EQ("namespace N {\n"
 "void f()\n"
-"}",
+"} // namespace N",
 format("namespace  N  {  void f()  }"));
   EXPECT_EQ("namespace N {\n"
 "void f() {}\n"
@@ -9839,7 +9839,7 @@
   verifyFormat("namespace Foo\n"
"{\n"
"void Bar();\n"
-   "};",
+   "}; // namespace Foo",
Style);
 }
 
@@ -9872,7 +9872,7 @@
Style);
   verifyFormat("namespace Foo {\n"
"void Bar();\n"
-   "};",
+   "}; // namespace Foo",
Style);
 
   Style.BreakBeforeBraces = FormatStyle::BS_Custom;
@@ -9913,7 +9913,7 @@
   verifyFormat("namespace Foo\n"
"{\n"
"void Bar();\n"
-   "};",
+   "}; // namespace Foo",
Style);
 }
 
Index: clang/lib/Format/NamespaceEndCommentsFixer.cpp
===
--- clang/li

[PATCH] D87587: [clang-format] Make one-line namespaces resistant to FixNamespaceComments, update documentation

2020-09-13 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

This fixes https://bugs.llvm.org/show_bug.cgi?id=47290.

@Jake
I decided I would at least create this pull request so you can decide whether 
you want it or not.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87587/new/

https://reviews.llvm.org/D87587

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


[PATCH] D87587: [clang-format] Make one-line namespaces resistant to FixNamespaceComments, update documentation

2020-09-13 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry updated this revision to Diff 291466.
kuzkry added a comment.

Adjusted tests IncludeFixerTest.cpp after CI failure.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87587/new/

https://reviews.llvm.org/D87587

Files:
  clang-tools-extra/unittests/clang-include-fixer/IncludeFixerTest.cpp
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h
  clang/lib/Format/NamespaceEndCommentsFixer.cpp
  clang/unittests/Format/FormatTest.cpp
  clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp

Index: clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
===
--- clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
+++ clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
@@ -142,7 +142,7 @@
   EXPECT_EQ("namespace A {\n"
 "namespace B {\n"
 "int i;\n"
-"}\n"
+"}// namespace B\n"
 "}// namespace A",
 fixNamespaceEndComments("namespace A {\n"
 "namespace B {\n"
@@ -423,8 +423,9 @@
 TEST_F(NamespaceEndCommentsFixerTest, DoesNotAddEndCommentForShortNamespace) {
   EXPECT_EQ("namespace {}", fixNamespaceEndComments("namespace {}"));
   EXPECT_EQ("namespace A {}", fixNamespaceEndComments("namespace A {}"));
-  EXPECT_EQ("namespace A { a }", fixNamespaceEndComments("namespace A { a }"));
-  EXPECT_EQ("namespace A { a };",
+  EXPECT_EQ("namespace A { a }// namespace A",
+fixNamespaceEndComments("namespace A { a }"));
+  EXPECT_EQ("namespace A { a };// namespace A",
 fixNamespaceEndComments("namespace A { a };"));
 }
 
Index: clang/unittests/Format/FormatTest.cpp
===
--- clang/unittests/Format/FormatTest.cpp
+++ clang/unittests/Format/FormatTest.cpp
@@ -211,7 +211,7 @@
   EXPECT_EQ("namespace N {\n"
 "\n"
 "int i;\n"
-"}",
+"}  // namespace N",
 format("namespace N {\n"
"\n"
"inti;\n"
@@ -220,7 +220,7 @@
   EXPECT_EQ("/* something */ namespace N {\n"
 "\n"
 "int i;\n"
-"}",
+"}  // namespace N",
 format("/* something */ namespace N {\n"
"\n"
"inti;\n"
@@ -229,7 +229,7 @@
   EXPECT_EQ("inline namespace N {\n"
 "\n"
 "int i;\n"
-"}",
+"}  // namespace N",
 format("inline namespace N {\n"
"\n"
"inti;\n"
@@ -238,7 +238,7 @@
   EXPECT_EQ("/* something */ inline namespace N {\n"
 "\n"
 "int i;\n"
-"}",
+"}  // namespace N",
 format("/* something */ inline namespace N {\n"
"\n"
"inti;\n"
@@ -247,7 +247,7 @@
   EXPECT_EQ("export namespace N {\n"
 "\n"
 "int i;\n"
-"}",
+"}  // namespace N",
 format("export namespace N {\n"
"\n"
"inti;\n"
@@ -369,7 +369,7 @@
   EXPECT_EQ("namespace {\n"
 "int i;\n"
 "\n"
-"}",
+"} // namespace",
 format("namespace {\n"
"int i;\n"
"\n"
@@ -8887,7 +8887,7 @@
 format("void  f  (  )  {  if  ( a )  return  }"));
   EXPECT_EQ("namespace N {\n"
 "void f()\n"
-"}",
+"} // namespace N",
 format("namespace  N  {  void f()  }"));
   EXPECT_EQ("namespace N {\n"
 "void f() {}\n"
@@ -9839,7 +9839,7 @@
   verifyFormat("namespace Foo\n"
"{\n"
"void Bar();\n"
-   "};",
+   "}; // namespace Foo",
Style);
 }
 
@@ -9872,7 +9872,7 @@
Style);
   verifyFormat("namespace Foo {\n"
"void Bar();\n"
-   "};",
+   "}; // namespace Foo",
Style);
 
   Style.BreakBeforeBraces = FormatStyle::BS_Custom;
@@ -9913,7 +9913,7 @@
   verifyFormat("namespace Foo\n"
"{\n"
"void Bar();\n"
-   "};",
+   "}; // namespace Foo",
Style);
 }
 
Index: clang/lib/Format/NamespaceEndCommentsFixer.cpp
===
--- clang/lib/Format/NamespaceEndCommentsFixer.cpp
+++ clang/lib/Format/NamespaceEndCommentsFixer.cpp
@@ -24,7 +24,7 @@
 namespace {
 // The maximal number of unwrapped lines that a short namespace spans.
 // Short namespaces don't need an end comment.
-static const int kShortNamespaceMaxLines = 1;
+static const int kShortNamespaceMaxLines = 0;
 
 // Computes the name of a namespace given the namespace token.
 // Returns "" for anonymous namespace.
Index: c

[PATCH] D87587: [clang-format] Make one-line namespaces resistant to FixNamespaceComments, update documentation

2020-09-13 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry updated this revision to Diff 291468.
kuzkry added a comment.

Formatted code after CI failure.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87587/new/

https://reviews.llvm.org/D87587

Files:
  clang-tools-extra/unittests/clang-include-fixer/IncludeFixerTest.cpp
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h
  clang/lib/Format/NamespaceEndCommentsFixer.cpp
  clang/unittests/Format/FormatTest.cpp
  clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp

Index: clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
===
--- clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
+++ clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
@@ -142,7 +142,7 @@
   EXPECT_EQ("namespace A {\n"
 "namespace B {\n"
 "int i;\n"
-"}\n"
+"}// namespace B\n"
 "}// namespace A",
 fixNamespaceEndComments("namespace A {\n"
 "namespace B {\n"
@@ -423,8 +423,9 @@
 TEST_F(NamespaceEndCommentsFixerTest, DoesNotAddEndCommentForShortNamespace) {
   EXPECT_EQ("namespace {}", fixNamespaceEndComments("namespace {}"));
   EXPECT_EQ("namespace A {}", fixNamespaceEndComments("namespace A {}"));
-  EXPECT_EQ("namespace A { a }", fixNamespaceEndComments("namespace A { a }"));
-  EXPECT_EQ("namespace A { a };",
+  EXPECT_EQ("namespace A { a }// namespace A",
+fixNamespaceEndComments("namespace A { a }"));
+  EXPECT_EQ("namespace A { a };// namespace A",
 fixNamespaceEndComments("namespace A { a };"));
 }
 
Index: clang/unittests/Format/FormatTest.cpp
===
--- clang/unittests/Format/FormatTest.cpp
+++ clang/unittests/Format/FormatTest.cpp
@@ -211,7 +211,7 @@
   EXPECT_EQ("namespace N {\n"
 "\n"
 "int i;\n"
-"}",
+"}  // namespace N",
 format("namespace N {\n"
"\n"
"inti;\n"
@@ -220,7 +220,7 @@
   EXPECT_EQ("/* something */ namespace N {\n"
 "\n"
 "int i;\n"
-"}",
+"}  // namespace N",
 format("/* something */ namespace N {\n"
"\n"
"inti;\n"
@@ -229,7 +229,7 @@
   EXPECT_EQ("inline namespace N {\n"
 "\n"
 "int i;\n"
-"}",
+"}  // namespace N",
 format("inline namespace N {\n"
"\n"
"inti;\n"
@@ -238,7 +238,7 @@
   EXPECT_EQ("/* something */ inline namespace N {\n"
 "\n"
 "int i;\n"
-"}",
+"}  // namespace N",
 format("/* something */ inline namespace N {\n"
"\n"
"inti;\n"
@@ -247,7 +247,7 @@
   EXPECT_EQ("export namespace N {\n"
 "\n"
 "int i;\n"
-"}",
+"}  // namespace N",
 format("export namespace N {\n"
"\n"
"inti;\n"
@@ -369,7 +369,7 @@
   EXPECT_EQ("namespace {\n"
 "int i;\n"
 "\n"
-"}",
+"} // namespace",
 format("namespace {\n"
"int i;\n"
"\n"
@@ -8887,7 +8887,7 @@
 format("void  f  (  )  {  if  ( a )  return  }"));
   EXPECT_EQ("namespace N {\n"
 "void f()\n"
-"}",
+"} // namespace N",
 format("namespace  N  {  void f()  }"));
   EXPECT_EQ("namespace N {\n"
 "void f() {}\n"
@@ -9839,7 +9839,7 @@
   verifyFormat("namespace Foo\n"
"{\n"
"void Bar();\n"
-   "};",
+   "}; // namespace Foo",
Style);
 }
 
@@ -9872,7 +9872,7 @@
Style);
   verifyFormat("namespace Foo {\n"
"void Bar();\n"
-   "};",
+   "}; // namespace Foo",
Style);
 
   Style.BreakBeforeBraces = FormatStyle::BS_Custom;
@@ -9913,7 +9913,7 @@
   verifyFormat("namespace Foo\n"
"{\n"
"void Bar();\n"
-   "};",
+   "}; // namespace Foo",
Style);
 }
 
Index: clang/lib/Format/NamespaceEndCommentsFixer.cpp
===
--- clang/lib/Format/NamespaceEndCommentsFixer.cpp
+++ clang/lib/Format/NamespaceEndCommentsFixer.cpp
@@ -24,7 +24,7 @@
 namespace {
 // The maximal number of unwrapped lines that a short namespace spans.
 // Short namespaces don't need an end comment.
-static const int kShortNamespaceMaxLines = 1;
+static const int kShortNamespaceMaxLines = 0;
 
 // Computes the name of a namespace given the namespace token.
 // Returns "" for anonymous namespace.
Index: clang/include/clang/Fo

[PATCH] D87587: [clang-format] Make one-line namespaces resistant to FixNamespaceComments, update documentation

2020-09-14 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

Thanks @JakeMerdichAMD for your quick feedback.

> In any case, can you also add the full diff context? It makes it easier for 
> us to review.

I'll do that starting from the next patch because I'm afraid if I resubmit the 
longer version of the same patch, your comment would be hidden or considered 
obsolete as it would refer to an older revision.




Comment at: clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp:426-428
+  EXPECT_EQ("namespace A { a }// namespace A",
+fixNamespaceEndComments("namespace A { a }"));
+  EXPECT_EQ("namespace A { a };// namespace A",

JakeMerdichAMD wrote:
> I strongly believe that these ones are not correct. Namespaces that are 
> entirely on one line should never have a trailing comment, even if it has 
> content in it. 
> 
> A solution would also have to take into account whether future passes would 
> split this onto separate lines (and thus have a different result after 
> re-running clang-format), which was the reason for this limitation in the 
> first place. 
You're absolutely right. Btw. do you happen to know which style option controls 
this behaviour that splits these namespaces onto separate lines?
Anyway, I'm going to look into this in a few days.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87587/new/

https://reviews.llvm.org/D87587

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


[PATCH] D87587: [clang-format][PR47290] Make one-line namespaces resistant to FixNamespaceComments, update documentation

2020-09-14 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

Hey @MyDeveloperDay, thanks for the review.

On the one hand, you're right, it's a breaking change and I dislike it too.
But please, reconsider because on the other hand:
a) adding a new option means increasing our maintenance cost by possibly adding 
a rarely-used switch (which I also dislike)
b) it's been a part of clang-format documentation since release 5 so we could 
make clang-format work as expected
c) this patch doesn't have to be applied to already released versions and could 
be merged with a new major release. I think people can expect certain things to 
work differently while changing major versions.
d) in general, people care about preserving their git history and they normally 
don't format all their code blindly. I think the most frequent use case it to 
format only adjacent parts of code.

So, I'd say both ways have their ups and downs.

@all
Still, so far I've got two change requests from you lot but they are mutually 
exclusive.
To sum it up, which do you prefer?
a) add a new option (@MyDeveloperDay's approach)
b) change kShortNamespaceMaxLines (my approach) assuming @JakeMerdichAMD's 
suggestions (non-empty one-line namespaces aren't given the end comment)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87587/new/

https://reviews.llvm.org/D87587

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


[PATCH] D87587: [clang-format][PR47290] Make one-line namespaces resistant to FixNamespaceComments, update documentation

2020-09-16 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

Thanks @MyDeveloperDay, I appreciate your input in this review. You're a good 
reviewer. :)
Also, I think you've made some good points there and I'm going to turn this 
review into "non-breaking the world" one. I'll be back in a few days with a new 
diff.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87587/new/

https://reviews.llvm.org/D87587

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


[PATCH] D87587: [clang-format][PR47290] Add MaxUnwrappedLinesForShortNamespace format option

2020-12-19 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry updated this revision to Diff 312940.
kuzkry retitled this revision from "[clang-format][PR47290] Make one-line 
namespaces resistant to FixNamespaceComments, update documentation" to 
"[clang-format][PR47290] Add MaxUnwrappedLinesForShortNamespace format option".
kuzkry edited the summary of this revision.
kuzkry added a comment.

As proposed by @MyDeveloperDay, I added MaxUnwrappedLinesForShortNamespace 
option to control behaviour of FixNamespaceComments. This time I'm providing 
you with a full diff.
Btw. sorry for taking so long.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87587/new/

https://reviews.llvm.org/D87587

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h
  clang/lib/Format/Format.cpp
  clang/lib/Format/NamespaceEndCommentsFixer.cpp
  clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp

Index: clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
===
--- clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
+++ clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
@@ -816,7 +816,7 @@
 "}\n"));
 }
 
-TEST_F(NamespaceEndCommentsFixerTest, AddEndCommentForNamespacesAroundMacros) {
+TEST_F(NamespaceEndCommentsFixerTest, AddsEndCommentForNamespacesAroundMacros) {
   // Conditional blocks around are fine
   EXPECT_EQ("namespace A {\n"
 "#if 1\n"
@@ -1116,6 +1116,92 @@
 "}\n"
 "}\n"));
 }
+
+using MaxUnwrappedLinesForShortNamespaceTest = NamespaceEndCommentsFixerTest;
+
+TEST_F(MaxUnwrappedLinesForShortNamespaceTest, DefaultsToOneUnwrappedLine) {
+  constexpr auto UnwrappedLines = 1u;
+  auto const Style = getLLVMStyle();
+
+  EXPECT_EQ(UnwrappedLines, Style.MaxUnwrappedLinesForShortNamespace);
+}
+
+TEST_F(MaxUnwrappedLinesForShortNamespaceTest,
+   ZeroUnwrappedLines_DoesNotAddEndCommentForOneLinerNamespace) {
+  auto Style = getLLVMStyle();
+  Style.MaxUnwrappedLinesForShortNamespace = 0;
+
+  EXPECT_EQ("namespace OneLinerNamespace {}\n",
+fixNamespaceEndComments("namespace OneLinerNamespace {}\n", Style));
+}
+
+TEST_F(MaxUnwrappedLinesForShortNamespaceTest,
+   ZeroUnwrappedLines_DoesNotAddEndCommentForNonOneLinerNamespace) {
+  auto Style = getLLVMStyle();
+  Style.MaxUnwrappedLinesForShortNamespace = 0;
+
+  EXPECT_EQ("namespace NonOneLinerNamespace {\n"
+"}\n",
+fixNamespaceEndComments("namespace NonOneLinerNamespace {\n"
+"}\n",
+Style));
+}
+
+TEST_F(MaxUnwrappedLinesForShortNamespaceTest,
+   OneUnwrappedLine_DoesNotAddEndCommentForShortNamespace) {
+  EXPECT_EQ("namespace ShortNamespace {\n"
+"int i;\n"
+"}\n",
+fixNamespaceEndComments("namespace ShortNamespace {\n"
+"int i;\n"
+"}\n"));
+}
+
+TEST_F(MaxUnwrappedLinesForShortNamespaceTest,
+   OneUnwrappedLine_AddsEndCommentForLongNamespace) {
+  EXPECT_EQ("namespace LongNamespace {\n"
+"int i;\n"
+"int j;\n"
+"}// namespace LongNamespace\n",
+fixNamespaceEndComments("namespace LongNamespace {\n"
+"int i;\n"
+"int j;\n"
+"}\n"));
+}
+
+TEST_F(MaxUnwrappedLinesForShortNamespaceTest,
+   MultipleUnwrappedLine_DoesNotAddEndCommentForShortNamespace) {
+  auto Style = getLLVMStyle();
+  Style.MaxUnwrappedLinesForShortNamespace = 2;
+
+  EXPECT_EQ("namespace ShortNamespace {\n"
+"int i;\n"
+"int j;\n"
+"}\n",
+fixNamespaceEndComments("namespace ShortNamespace {\n"
+"int i;\n"
+"int j;\n"
+"}\n",
+Style));
+}
+
+TEST_F(MaxUnwrappedLinesForShortNamespaceTest,
+   MultipleUnwrappedLine_AddsEndCommentForLongNamespace) {
+  auto Style = getLLVMStyle();
+  Style.MaxUnwrappedLinesForShortNamespace = 2;
+
+  EXPECT_EQ("namespace LongNamespace {\n"
+"int i;\n"
+"int j;\n"
+"int k;\n"
+"}// namespace LongNamespace\n",
+fixNamespaceEndComments("namespace LongNamespace {\n"
+"int i;\n"
+"int j;\n"
+"int k;\n"
+"}\n",
+Style));
+}
 } // end namespace
 } // end namespace format
 } // end namespace clang
Index: clang/lib/Format/NamespaceEndCommentsFixer.cpp
===
--- clang/lib/Format/NamespaceEndC

[PATCH] D87587: [clang-format][PR47290] Add ShortNamespaceLines format option

2020-12-21 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry updated this revision to Diff 313218.
kuzkry retitled this revision from "[clang-format][PR47290] Add 
MaxUnwrappedLinesForShortNamespace format option" to "[clang-format][PR47290] 
Add ShortNamespaceLines format option".
kuzkry added a comment.

Renamed MaxUnwrappedLinesForShortNamespace to ShortNamespaceLines (thank you 
@MyDeveloperDay for the idea and @curdeius for mentioning clang-tidy). I 
haven't changed the description of this option so you might wanna complain on 
that. Tbh. English isn't my native language so I'll take your tips if you wanna 
help simplify it.

Luckily formatting is magically fixed and hopefully CI check's gonna be 
satisfied.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87587/new/

https://reviews.llvm.org/D87587

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h
  clang/lib/Format/Format.cpp
  clang/lib/Format/NamespaceEndCommentsFixer.cpp
  clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp

Index: clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
===
--- clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
+++ clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
@@ -816,7 +816,7 @@
 "}\n"));
 }
 
-TEST_F(NamespaceEndCommentsFixerTest, AddEndCommentForNamespacesAroundMacros) {
+TEST_F(NamespaceEndCommentsFixerTest, AddsEndCommentForNamespacesAroundMacros) {
   // Conditional blocks around are fine
   EXPECT_EQ("namespace A {\n"
 "#if 1\n"
@@ -1116,6 +1116,92 @@
 "}\n"
 "}\n"));
 }
+
+using ShortNamespaceLinesTest = NamespaceEndCommentsFixerTest;
+
+TEST_F(ShortNamespaceLinesTest, DefaultsToOneUnwrappedLine) {
+  constexpr auto UnwrappedLines = 1u;
+  auto const Style = getLLVMStyle();
+
+  EXPECT_EQ(UnwrappedLines, Style.ShortNamespaceLines);
+}
+
+TEST_F(ShortNamespaceLinesTest,
+   ZeroUnwrappedLines_DoesNotAddEndCommentForOneLinerNamespace) {
+  auto Style = getLLVMStyle();
+  Style.ShortNamespaceLines = 0;
+
+  EXPECT_EQ("namespace OneLinerNamespace {}\n",
+fixNamespaceEndComments("namespace OneLinerNamespace {}\n", Style));
+}
+
+TEST_F(ShortNamespaceLinesTest,
+   ZeroUnwrappedLines_DoesNotAddEndCommentForNonOneLinerNamespace) {
+  auto Style = getLLVMStyle();
+  Style.ShortNamespaceLines = 0;
+
+  EXPECT_EQ("namespace NonOneLinerNamespace {\n"
+"}\n",
+fixNamespaceEndComments("namespace NonOneLinerNamespace {\n"
+"}\n",
+Style));
+}
+
+TEST_F(ShortNamespaceLinesTest,
+   OneUnwrappedLine_DoesNotAddEndCommentForShortNamespace) {
+  EXPECT_EQ("namespace ShortNamespace {\n"
+"int i;\n"
+"}\n",
+fixNamespaceEndComments("namespace ShortNamespace {\n"
+"int i;\n"
+"}\n"));
+}
+
+TEST_F(ShortNamespaceLinesTest,
+   OneUnwrappedLine_AddsEndCommentForLongNamespace) {
+  EXPECT_EQ("namespace LongNamespace {\n"
+"int i;\n"
+"int j;\n"
+"}// namespace LongNamespace\n",
+fixNamespaceEndComments("namespace LongNamespace {\n"
+"int i;\n"
+"int j;\n"
+"}\n"));
+}
+
+TEST_F(ShortNamespaceLinesTest,
+   MultipleUnwrappedLine_DoesNotAddEndCommentForShortNamespace) {
+  auto Style = getLLVMStyle();
+  Style.ShortNamespaceLines = 2;
+
+  EXPECT_EQ("namespace ShortNamespace {\n"
+"int i;\n"
+"int j;\n"
+"}\n",
+fixNamespaceEndComments("namespace ShortNamespace {\n"
+"int i;\n"
+"int j;\n"
+"}\n",
+Style));
+}
+
+TEST_F(ShortNamespaceLinesTest,
+   MultipleUnwrappedLine_AddsEndCommentForLongNamespace) {
+  auto Style = getLLVMStyle();
+  Style.ShortNamespaceLines = 2;
+
+  EXPECT_EQ("namespace LongNamespace {\n"
+"int i;\n"
+"int j;\n"
+"int k;\n"
+"}// namespace LongNamespace\n",
+fixNamespaceEndComments("namespace LongNamespace {\n"
+"int i;\n"
+"int j;\n"
+"int k;\n"
+"}\n",
+Style));
+}
 } // end namespace
 } // end namespace format
 } // end namespace clang
Index: clang/lib/Format/NamespaceEndCommentsFixer.cpp
===
--- clang/lib/Format/NamespaceEndCommentsFixer.cpp
+++ clang/lib/Format/NamespaceEndCommentsFixer.cpp
@@ -22

[PATCH] D87587: [clang-format][PR47290] Add ShortNamespaceLines format option

2021-02-10 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry updated this revision to Diff 322880.
kuzkry added a comment.

Sorted code alphabetically as suggested by @HazardyKnusperkeks and applied 
almost all fixes proposed by @curdeius (entry in release notes + some changes 
in unit tests)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87587/new/

https://reviews.llvm.org/D87587

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Format/Format.h
  clang/lib/Format/Format.cpp
  clang/lib/Format/NamespaceEndCommentsFixer.cpp
  clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp

Index: clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
===
--- clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
+++ clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
@@ -816,7 +816,7 @@
 "}\n"));
 }
 
-TEST_F(NamespaceEndCommentsFixerTest, AddEndCommentForNamespacesAroundMacros) {
+TEST_F(NamespaceEndCommentsFixerTest, AddsEndCommentForNamespacesAroundMacros) {
   // Conditional blocks around are fine
   EXPECT_EQ("namespace A {\n"
 "#if 1\n"
@@ -1116,6 +1116,107 @@
 "}\n"
 "}\n"));
 }
+
+using ShortNamespaceLinesTest = NamespaceEndCommentsFixerTest;
+
+TEST_F(ShortNamespaceLinesTest,
+   ZeroUnwrappedLines_DoesNotAddEndCommentForOneLinerNamespace) {
+  auto Style = getLLVMStyle();
+  Style.ShortNamespaceLines = 0u;
+
+  EXPECT_EQ("namespace OneLinerNamespace {}\n",
+fixNamespaceEndComments("namespace OneLinerNamespace {}\n", Style));
+}
+
+TEST_F(ShortNamespaceLinesTest,
+   ZeroUnwrappedLines_DoesNotAddEndCommentForShortNamespace) {
+  auto Style = getLLVMStyle();
+  Style.ShortNamespaceLines = 0u;
+
+  EXPECT_EQ("namespace ShortNamespace {\n"
+"}\n",
+fixNamespaceEndComments("namespace ShortNamespace {\n"
+"}\n",
+Style));
+}
+
+TEST_F(ShortNamespaceLinesTest,
+   ZeroUnwrappedLines_AddsEndCommentForLongNamespace) {
+  auto Style = getLLVMStyle();
+  Style.ShortNamespaceLines = 0u;
+
+  EXPECT_EQ("namespace LongNamespace {\n"
+"int i;\n"
+"}// namespace LongNamespace\n",
+fixNamespaceEndComments("namespace LongNamespace {\n"
+"int i;\n"
+"}\n",
+Style));
+}
+
+TEST_F(ShortNamespaceLinesTest,
+   OneUnwrappedLine_DoesNotAddEndCommentForShortNamespace) {
+  constexpr auto DefaultUnwrappedLines = 1u;
+  auto const Style = getLLVMStyle();
+
+  EXPECT_EQ(DefaultUnwrappedLines, Style.ShortNamespaceLines);
+  EXPECT_EQ("namespace ShortNamespace {\n"
+"int i;\n"
+"}\n",
+fixNamespaceEndComments("namespace ShortNamespace {\n"
+"int i;\n"
+"}\n"));
+}
+
+TEST_F(ShortNamespaceLinesTest,
+   OneUnwrappedLine_AddsEndCommentForLongNamespace) {
+  constexpr auto DefaultUnwrappedLines = 1u;
+  auto const Style = getLLVMStyle();
+
+  EXPECT_EQ(DefaultUnwrappedLines, Style.ShortNamespaceLines);
+  EXPECT_EQ("namespace LongNamespace {\n"
+"int i;\n"
+"int j;\n"
+"}// namespace LongNamespace\n",
+fixNamespaceEndComments("namespace LongNamespace {\n"
+"int i;\n"
+"int j;\n"
+"}\n"));
+}
+
+TEST_F(ShortNamespaceLinesTest,
+   MultipleUnwrappedLine_DoesNotAddEndCommentForShortNamespace) {
+  auto Style = getLLVMStyle();
+  Style.ShortNamespaceLines = 2u;
+
+  EXPECT_EQ("namespace ShortNamespace {\n"
+"int i;\n"
+"int j;\n"
+"}\n",
+fixNamespaceEndComments("namespace ShortNamespace {\n"
+"int i;\n"
+"int j;\n"
+"}\n",
+Style));
+}
+
+TEST_F(ShortNamespaceLinesTest,
+   MultipleUnwrappedLine_AddsEndCommentForLongNamespace) {
+  auto Style = getLLVMStyle();
+  Style.ShortNamespaceLines = 2u;
+
+  EXPECT_EQ("namespace LongNamespace {\n"
+"int i;\n"
+"int j;\n"
+"int k;\n"
+"}// namespace LongNamespace\n",
+fixNamespaceEndComments("namespace LongNamespace {\n"
+"int i;\n"
+"int j;\n"
+"int k;\n"
+"}\n",
+Style));
+}
 } // end namespace
 } // end namespace format
 } // end namespace clang
Index: clang/lib/Format/NamespaceEndCommentsFixer.cpp
==

[PATCH] D87587: [clang-format][PR47290] Add ShortNamespaceLines format option

2021-02-10 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry marked 3 inline comments as done.
kuzkry added a comment.

In D87587#2552232 , 
@HazardyKnusperkeks wrote:

> Apart from my comments, this looks good to me and I really wonder why it 
> hasn't been pushed. (I would directly use it!)

I don't know, maybe noone needed this except for us :D




Comment at: clang/include/clang/Format/Format.h:2821
MaxEmptyLinesToKeep == R.MaxEmptyLinesToKeep &&
+   ShortNamespaceLines == R.ShortNamespaceLines &&
NamespaceIndentation == R.NamespaceIndentation &&

HazardyKnusperkeks wrote:
> Could you sort this one alphabetically?
Oops, I just sed'ed through it when renaming and forgot to sort it. Thx :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87587/new/

https://reviews.llvm.org/D87587

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


[PATCH] D87587: [clang-format][PR47290] Add ShortNamespaceLines format option

2021-02-10 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry marked 3 inline comments as done.
kuzkry added a comment.

In D87587#2552314 , @curdeius wrote:

> Please regroup tests and add release notes.

Regroup tests - by that I think you meant all your 4 remarks about the tests. 
So I've done 3/4 :D
Release notes - done




Comment at: clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp:1126
+
+  EXPECT_EQ(UnwrappedLines, Style.ShortNamespaceLines);
+}

curdeius wrote:
> This could be tested together with another test.
I merged it with "OneUnwrappedLine_*" tests



Comment at: clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp:1129
+
+TEST_F(ShortNamespaceLinesTest,
+   ZeroUnwrappedLines_DoesNotAddEndCommentForOneLinerNamespace) {

curdeius wrote:
> In general, I think you can merge some test cases to match the current 
> testing "style".
Sorry, I didn't understand what you meant so I skipped this one for now.



Comment at: clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp:1161
+TEST_F(ShortNamespaceLinesTest,
+   OneUnwrappedLine_AddsEndCommentForLongNamespace) {
+  EXPECT_EQ("namespace LongNamespace {\n"

curdeius wrote:
> You should check that Style.ShortNamespaceLines is 1 here.
My initial idea was to have a separated test that would validate 
ShortNamespaceLines defaulting to "1". If that test failed, someone would know 
why and they might think:
"Oh my, I think I broke something, let's see what. Oh, I see the test is called 
"DefaultsToOneUnwrappedLine" so I probably changed this default". Now, some 
example test, say "OneUnwrappedLine_AddsEndCommentForLongNamespace", does two 
things, which is a bit like trying to kill two birds with one stone making it, 
imho, a bit inferior.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87587/new/

https://reviews.llvm.org/D87587

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


[PATCH] D87587: [clang-format][PR47290] Add ShortNamespaceLines format option

2021-02-12 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry updated this revision to Diff 323289.
kuzkry marked 2 inline comments as done.
kuzkry added a comment.

Rebased to the tip of the main branch, merged similar tests (requested by 
@curdeius)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87587/new/

https://reviews.llvm.org/D87587

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Format/Format.h
  clang/lib/Format/Format.cpp
  clang/lib/Format/NamespaceEndCommentsFixer.cpp
  clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp

Index: clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
===
--- clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
+++ clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp
@@ -816,7 +816,7 @@
 "}\n"));
 }
 
-TEST_F(NamespaceEndCommentsFixerTest, AddEndCommentForNamespacesAroundMacros) {
+TEST_F(NamespaceEndCommentsFixerTest, AddsEndCommentForNamespacesAroundMacros) {
   // Conditional blocks around are fine
   EXPECT_EQ("namespace A {\n"
 "#if 1\n"
@@ -1116,6 +1116,75 @@
 "}\n"
 "}\n"));
 }
+
+using ShortNamespaceLinesTest = NamespaceEndCommentsFixerTest;
+
+TEST_F(ShortNamespaceLinesTest, ZeroUnwrappedLines) {
+  auto Style = getLLVMStyle();
+  Style.ShortNamespaceLines = 0u;
+
+  EXPECT_EQ("namespace OneLinerNamespace {}\n",
+fixNamespaceEndComments("namespace OneLinerNamespace {}\n", Style));
+  EXPECT_EQ("namespace ShortNamespace {\n"
+"}\n",
+fixNamespaceEndComments("namespace ShortNamespace {\n"
+"}\n",
+Style));
+  EXPECT_EQ("namespace LongNamespace {\n"
+"int i;\n"
+"}// namespace LongNamespace\n",
+fixNamespaceEndComments("namespace LongNamespace {\n"
+"int i;\n"
+"}\n",
+Style));
+}
+
+TEST_F(ShortNamespaceLinesTest, OneUnwrappedLine) {
+  constexpr auto DefaultUnwrappedLines = 1u;
+  auto const Style = getLLVMStyle();
+
+  EXPECT_EQ(DefaultUnwrappedLines, Style.ShortNamespaceLines);
+  EXPECT_EQ("namespace ShortNamespace {\n"
+"int i;\n"
+"}\n",
+fixNamespaceEndComments("namespace ShortNamespace {\n"
+"int i;\n"
+"}\n"));
+  EXPECT_EQ("namespace LongNamespace {\n"
+"int i;\n"
+"int j;\n"
+"}// namespace LongNamespace\n",
+fixNamespaceEndComments("namespace LongNamespace {\n"
+"int i;\n"
+"int j;\n"
+"}\n"));
+}
+
+TEST_F(ShortNamespaceLinesTest, MultipleUnwrappedLine) {
+  auto Style = getLLVMStyle();
+  Style.ShortNamespaceLines = 2u;
+
+  EXPECT_EQ("namespace ShortNamespace {\n"
+"int i;\n"
+"int j;\n"
+"}\n",
+fixNamespaceEndComments("namespace ShortNamespace {\n"
+"int i;\n"
+"int j;\n"
+"}\n",
+Style));
+  EXPECT_EQ("namespace LongNamespace {\n"
+"int i;\n"
+"int j;\n"
+"int k;\n"
+"}// namespace LongNamespace\n",
+fixNamespaceEndComments("namespace LongNamespace {\n"
+"int i;\n"
+"int j;\n"
+"int k;\n"
+"}\n",
+Style));
+}
 } // end namespace
 } // end namespace format
 } // end namespace clang
Index: clang/lib/Format/NamespaceEndCommentsFixer.cpp
===
--- clang/lib/Format/NamespaceEndCommentsFixer.cpp
+++ clang/lib/Format/NamespaceEndCommentsFixer.cpp
@@ -22,10 +22,6 @@
 namespace format {
 
 namespace {
-// The maximal number of unwrapped lines that a short namespace spans.
-// Short namespaces don't need an end comment.
-static const int kShortNamespaceMaxLines = 1;
-
 // Computes the name of a namespace given the namespace token.
 // Returns "" for anonymous namespace.
 std::string computeName(const FormatToken *NamespaceTok) {
@@ -283,7 +279,7 @@
 computeEndCommentText(NamespaceName, AddNewline, NamespaceTok,
   Style.SpacesInLineCommentPrefix.Minimum);
 if (!hasEndComment(EndCommentPrevTok)) {
-  bool isShort = I - StartLineIndex <= kShortNamespaceMaxLines + 1;
+  bool isShort = I - StartLineIndex <= Style.ShortNamespaceLines + 1;
   if (!isShort)
 addEnd

[PATCH] D87587: [clang-format][PR47290] Add ShortNamespaceLines format option

2021-02-12 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry marked 2 inline comments as done.
kuzkry added inline comments.



Comment at: clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp:1162
+
+  EXPECT_EQ(DefaultUnwrappedLines, Style.ShortNamespaceLines);
+  EXPECT_EQ("namespace ShortNamespace {\n"

curdeius wrote:
> Nit.
Well, instead of using comments or giving it a separate test, I wanted to have 
a nice self-explanatory name.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87587/new/

https://reviews.llvm.org/D87587

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


[PATCH] D87587: [clang-format][PR47290] Add ShortNamespaceLines format option

2021-02-27 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

> Do you need someone to push it?

Yes, I need someone to do that. I don't have write permissions. I'm new here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87587/new/

https://reviews.llvm.org/D87587

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


[PATCH] D87587: [clang-format][PR47290] Add ShortNamespaceLines format option

2021-02-28 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

In D87587#2592722 , 
@HazardyKnusperkeks wrote:

> In D87587#2592605 , @kuzkry wrote:
>
>>> Do you need someone to push it?
>>
>> Yes, I need someone to do that. I don't have write permissions. I'm new here.
>
> Please state the name and mail for the commit. I will push it for you.

Name: Krystian Kuzniarek
Email: krystian.kuznia...@gmail.com


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87587/new/

https://reviews.llvm.org/D87587

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


[PATCH] D87587: [clang-format][PR47290] Add ShortNamespaceLines format option

2021-03-02 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

Thank you for delivering it, @HazardyKnusperkeks.

One thing concerns me though. I'm not an author of changes done in 
clang/docs/ClangFormatStyleOptions.rst in lines 2372, 3069-3073, 3075, 3077, 
3082-3086, 3088, 3093-3097, 3099, 3104-3108, and 3110-3111. Perhaps it's just a 
mistake (something might have slipped through `git add`). Please let me know.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87587/new/

https://reviews.llvm.org/D87587

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


[PATCH] D87587: [clang-format][PR47290] Add ShortNamespaceLines format option

2021-03-09 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

In D87587#2602523 , 
@HazardyKnusperkeks wrote:

> In D87587#2597241 , @kuzkry wrote:
>
>> Thank you for delivering it, @HazardyKnusperkeks.
>>
>> One thing concerns me though. I'm not an author of changes done in 
>> clang/docs/ClangFormatStyleOptions.rst in lines 2372, 3069-3073, 3075, 3077, 
>> 3082-3086, 3088, 3093-3097, 3099, 3104-3108, and 3110-3111. Perhaps it's 
>> just a mistake (something might have slipped through `git add`). Please let 
>> me know.
>
> I've just run `dump_format_style.py`, why the other lines were changed (or 
> not correct before) I don't know, but this is the result of the official 
> script.
>
> If that bothers you I can revert and split it in two commits. But I don't 
> think that's necessary as the real author of those lines is the script, not 
> what's written in the git history.

Oh, no need to do that. Thank you for your involvement in this review.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87587/new/

https://reviews.llvm.org/D87587

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


[PATCH] D119682: [clang-format][docs] Fix incorrect 'clang-format 13' configuration options markers

2022-02-17 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

First of all, thanks @MyDeveloperDay for the approval.

In D119682#3321965 , @MyDeveloperDay 
wrote:

> @HazardyKnusperkeks could you validate the `IndentRequiresClause` I know I 
> added `IndentRequires` in 13 but is this the same option renamed or a new 
> option?

This was renamed and it was done in 9aab0db13fb6d21d1b70247a9b5e4cf916ee1c3a 
.

In D119682#3321975 , @MyDeveloperDay 
wrote:

> I understand what you are saying re 'IndentRequiresClause' but this leaves us 
> with people with "IndentRequires" in their .clang-format without any 
> understanding of what it means? i.e. what about the 14.0 people? if we've 
> renamed an option then the documentation should carry something like
>
> 'Previously known as IndentRequires'

I have no problems with adding it myself if you want. I think this is //nice to 
have// and I see nothing wrong in adding it.

In D119682#3322082 , 
@HazardyKnusperkeks wrote:

> In D119682#3321975 , 
> @MyDeveloperDay wrote:
>
>> I understand what you are saying re 'IndentRequiresClause' but this leaves 
>> us with people with "IndentRequires" in their .clang-format without any 
>> understanding of what it means? i.e. what about the 14.0 people? if we've 
>> renamed an option then the documentation should carry something like
>>
>> 'Previously known as IndentRequires'
>
> That's not the first time we renamed something. And most likely not the last 
> time.

But that doesn't mean we can't add "Previously known as IndentRequires", does 
it? :)

To all:
I'm willing to add "Previously known as IndentRequires" but please let me know 
if you're for or against it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119682/new/

https://reviews.llvm.org/D119682

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


[PATCH] D119682: [clang-format][docs] Fix incorrect 'clang-format 13' configuration options markers

2022-02-18 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry updated this revision to Diff 409935.
kuzkry added a comment.

Review fix: added note about IndentRequires. The generated HTML looks like this:
F22153448: IndentRequires note.png 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119682/new/

https://reviews.llvm.org/D119682

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h


Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -1791,7 +1791,7 @@
   };
 
   /// The concept declaration style to use.
-  /// \version 13
+  /// \version 12
   BreakBeforeConceptDeclarationsStyle BreakBeforeConceptDeclarations;
 
   /// If ``true``, ternary operators will be placed after line breaks.
@@ -2185,7 +2185,7 @@
   };
 
   /// Defines in which cases to put empty line before access modifiers.
-  /// \version 13
+  /// \version 12
   EmptyLineBeforeAccessModifierStyle EmptyLineBeforeAccessModifier;
 
   /// If ``true``, clang-format detects whether function calls and
@@ -2523,6 +2523,8 @@
 
   /// Indent the requires clause in a template. This only applies when
   /// ``RequiresClausePosition`` is ``OwnLine``, or ``WithFollowing``.
+  ///
+  /// In clang-format 13 and 14 it was named ``IndentRequires``.
   /// \code
   ///true:
   ///template 
@@ -2538,7 +2540,7 @@
   ///  //
   ///}
   /// \endcode
-  /// \version 13
+  /// \version 15
   bool IndentRequiresClause;
 
   /// The number of columns to use for indentation.
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -1988,7 +1988,7 @@
 
 
 
-**BreakBeforeConceptDeclarations** (``BreakBeforeConceptDeclarationsStyle``) 
:versionbadge:`clang-format 13`
+**BreakBeforeConceptDeclarations** (``BreakBeforeConceptDeclarationsStyle``) 
:versionbadge:`clang-format 12`
   The concept declaration style to use.
 
   Possible values:
@@ -2278,7 +2278,7 @@
 
 
 
-**EmptyLineBeforeAccessModifier** (``EmptyLineBeforeAccessModifierStyle``) 
:versionbadge:`clang-format 13`
+**EmptyLineBeforeAccessModifier** (``EmptyLineBeforeAccessModifierStyle``) 
:versionbadge:`clang-format 12`
   Defines in which cases to put empty line before access modifiers.
 
   Possible values:
@@ -2706,10 +2706,12 @@
 
 
 
-**IndentRequiresClause** (``Boolean``) :versionbadge:`clang-format 13`
+**IndentRequiresClause** (``Boolean``) :versionbadge:`clang-format 15`
   Indent the requires clause in a template. This only applies when
   ``RequiresClausePosition`` is ``OwnLine``, or ``WithFollowing``.
 
+  In clang-format 13 and 14 it was named ``IndentRequires``.
+
   .. code-block:: c++
 
  true:


Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -1791,7 +1791,7 @@
   };
 
   /// The concept declaration style to use.
-  /// \version 13
+  /// \version 12
   BreakBeforeConceptDeclarationsStyle BreakBeforeConceptDeclarations;
 
   /// If ``true``, ternary operators will be placed after line breaks.
@@ -2185,7 +2185,7 @@
   };
 
   /// Defines in which cases to put empty line before access modifiers.
-  /// \version 13
+  /// \version 12
   EmptyLineBeforeAccessModifierStyle EmptyLineBeforeAccessModifier;
 
   /// If ``true``, clang-format detects whether function calls and
@@ -2523,6 +2523,8 @@
 
   /// Indent the requires clause in a template. This only applies when
   /// ``RequiresClausePosition`` is ``OwnLine``, or ``WithFollowing``.
+  ///
+  /// In clang-format 13 and 14 it was named ``IndentRequires``.
   /// \code
   ///true:
   ///template 
@@ -2538,7 +2540,7 @@
   ///  //
   ///}
   /// \endcode
-  /// \version 13
+  /// \version 15
   bool IndentRequiresClause;
 
   /// The number of columns to use for indentation.
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -1988,7 +1988,7 @@
 
 
 
-**BreakBeforeConceptDeclarations** (``BreakBeforeConceptDeclarationsStyle``) :versionbadge:`clang-format 13`
+**BreakBeforeConceptDeclarations** (``BreakBeforeConceptDeclarationsStyle``) :versionbadge:`clang-format 12`
   The concept declaration style to use.
 
   Possible values:
@@ -2278,7 +2278,7 @@
 
 
 
-**EmptyLineBeforeAccessModifier** (``EmptyLineBeforeAccessModifierStyle``) :versionbadge:`clang-format 13`
+**EmptyLineBeforeAccessModifier** (``EmptyLineBeforeAccessModifierStyle``) :versionbadge:`clang-format 12`
   Defines in which cases to put empty line before access modifiers.
 
   Possible values:
@@ -2706,10 +2706,12 @@
 
 
 
-**IndentRequiresClaus

[PATCH] D119682: [clang-format][docs] Fix incorrect 'clang-format 13' configuration options markers

2022-02-18 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry marked 2 inline comments as done.
kuzkry added inline comments.



Comment at: clang/include/clang/Format/Format.h:2540-2541
   ///}
   /// \endcode
-  /// \version 13
+  /// \version 15
   bool IndentRequiresClause;

MyDeveloperDay wrote:
> HazardyKnusperkeks wrote:
> > 
> I like that suggestion..
Sorry, I didn't notice this inline comment before.

@HazardyKnusperkeks, I put it in a slightly different place, i.e. above the 
example code as Sphinx complained about this particular placement.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119682/new/

https://reviews.llvm.org/D119682

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


[PATCH] D119682: [clang-format][docs] Fix incorrect 'clang-format 13' configuration options markers

2022-02-18 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

Can I ask you to deliver this one for me? My name and email in git format is 
"Krystian Kuzniarek "


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119682/new/

https://reviews.llvm.org/D119682

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


[PATCH] D120220: [clang-format] fix typos and consistency

2022-02-20 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry created this revision.
kuzkry added reviewers: MyDeveloperDay, HazardyKnusperkeks.
kuzkry added a project: clang-format.
kuzkry requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120220

Files:
  clang/lib/Format/Format.cpp


Index: clang/lib/Format/Format.cpp
===
--- clang/lib/Format/Format.cpp
+++ clang/lib/Format/Format.cpp
@@ -990,11 +990,11 @@
   case ParseError::InvalidQualifierSpecified:
 return "Invalid qualifier specified in QualifierOrder";
   case ParseError::DuplicateQualifierSpecified:
-return "Duplicate qualifier specified in QualfierOrder";
+return "Duplicate qualifier specified in QualifierOrder";
   case ParseError::MissingQualifierType:
-return "Missing type in QualfierOrder";
+return "Missing type in QualifierOrder";
   case ParseError::MissingQualifierOrder:
-return "Missing QualfierOrder";
+return "Missing QualifierOrder";
   }
   llvm_unreachable("unexpected parse error");
 }
@@ -1650,7 +1650,8 @@
 if (token == tok::identifier)
   return ParseError::InvalidQualifierSpecified;
   }
-  // Ensure the list is unqiue (no duplicates).
+
+  // Ensure the list is unique (no duplicates).
   std::set UniqueQualifiers(Style->QualifierOrder.begin(),
  Style->QualifierOrder.end());
   if (Style->QualifierOrder.size() != UniqueQualifiers.size()) {
@@ -1660,10 +1661,12 @@
 return ParseError::DuplicateQualifierSpecified;
   }
 
+  // Ensure the list has 'type' in it
   auto type = std::find(Style->QualifierOrder.begin(),
 Style->QualifierOrder.end(), "type");
   if (type == Style->QualifierOrder.end())
 return ParseError::MissingQualifierType;
+
   return ParseError::Success;
 }
 


Index: clang/lib/Format/Format.cpp
===
--- clang/lib/Format/Format.cpp
+++ clang/lib/Format/Format.cpp
@@ -990,11 +990,11 @@
   case ParseError::InvalidQualifierSpecified:
 return "Invalid qualifier specified in QualifierOrder";
   case ParseError::DuplicateQualifierSpecified:
-return "Duplicate qualifier specified in QualfierOrder";
+return "Duplicate qualifier specified in QualifierOrder";
   case ParseError::MissingQualifierType:
-return "Missing type in QualfierOrder";
+return "Missing type in QualifierOrder";
   case ParseError::MissingQualifierOrder:
-return "Missing QualfierOrder";
+return "Missing QualifierOrder";
   }
   llvm_unreachable("unexpected parse error");
 }
@@ -1650,7 +1650,8 @@
 if (token == tok::identifier)
   return ParseError::InvalidQualifierSpecified;
   }
-  // Ensure the list is unqiue (no duplicates).
+
+  // Ensure the list is unique (no duplicates).
   std::set UniqueQualifiers(Style->QualifierOrder.begin(),
  Style->QualifierOrder.end());
   if (Style->QualifierOrder.size() != UniqueQualifiers.size()) {
@@ -1660,10 +1661,12 @@
 return ParseError::DuplicateQualifierSpecified;
   }
 
+  // Ensure the list has 'type' in it
   auto type = std::find(Style->QualifierOrder.begin(),
 Style->QualifierOrder.end(), "type");
   if (type == Style->QualifierOrder.end())
 return ParseError::MissingQualifierType;
+
   return ParseError::Success;
 }
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D120220: [clang-format] Fix typos and consistency

2022-02-20 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

Can I ask you to deliver this one for me? My name and email in git format is 
"Krystian Kuzniarek "


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120220/new/

https://reviews.llvm.org/D120220

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


[PATCH] D120221: [AST] Fix typos

2022-02-20 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry created this revision.
kuzkry added a project: clang.
kuzkry requested review of this revision.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120221

Files:
  clang/lib/AST/ASTDiagnostic.cpp


Index: clang/lib/AST/ASTDiagnostic.cpp
===
--- clang/lib/AST/ASTDiagnostic.cpp
+++ clang/lib/AST/ASTDiagnostic.cpp
@@ -372,7 +372,7 @@
 default: llvm_unreachable("unknown ArgumentKind");
 case DiagnosticsEngine::ak_addrspace: {
   assert(Modifier.empty() && Argument.empty() &&
- "Invalid modifier for Qualfiers argument");
+ "Invalid modifier for Qualifiers argument");
 
   auto S = Qualifiers::getAddrSpaceAsString(static_cast(Val));
   if (S.empty()) {
@@ -387,7 +387,7 @@
 }
 case DiagnosticsEngine::ak_qual: {
   assert(Modifier.empty() && Argument.empty() &&
- "Invalid modifier for Qualfiers argument");
+ "Invalid modifier for Qualifiers argument");
 
   Qualifiers Q(Qualifiers::fromOpaqueValue(Val));
   auto S = Q.getAsString();


Index: clang/lib/AST/ASTDiagnostic.cpp
===
--- clang/lib/AST/ASTDiagnostic.cpp
+++ clang/lib/AST/ASTDiagnostic.cpp
@@ -372,7 +372,7 @@
 default: llvm_unreachable("unknown ArgumentKind");
 case DiagnosticsEngine::ak_addrspace: {
   assert(Modifier.empty() && Argument.empty() &&
- "Invalid modifier for Qualfiers argument");
+ "Invalid modifier for Qualifiers argument");
 
   auto S = Qualifiers::getAddrSpaceAsString(static_cast(Val));
   if (S.empty()) {
@@ -387,7 +387,7 @@
 }
 case DiagnosticsEngine::ak_qual: {
   assert(Modifier.empty() && Argument.empty() &&
- "Invalid modifier for Qualfiers argument");
+ "Invalid modifier for Qualifiers argument");
 
   Qualifiers Q(Qualifiers::fromOpaqueValue(Val));
   auto S = Q.getAsString();
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D120221: [AST] Fix typos

2022-02-20 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

Can I ask you to deliver this one for me? I don't have permissions. My name and 
email in git format is "Krystian Kuzniarek "


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120221/new/

https://reviews.llvm.org/D120221

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


[PATCH] D120618: [clang-format][docs] Fix a bad comment

2022-02-26 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry created this revision.
kuzkry added a reviewer: HazardyKnusperkeks.
kuzkry added a project: clang-format.
kuzkry requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Follow up to 8f310d1967c20d348c617af3a30999031c71fee0 
.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120618

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h


Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -2524,7 +2524,7 @@
   /// Indent the requires clause in a template. This only applies when
   /// ``RequiresClausePosition`` is ``OwnLine``, or ``WithFollowing``.
   ///
-  /// In clang-format 13 and 14 it was named ``IndentRequires``.
+  /// In clang-format 12, 13 and 14 it was named ``IndentRequires``.
   /// \code
   ///true:
   ///template 
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -2710,7 +2710,7 @@
   Indent the requires clause in a template. This only applies when
   ``RequiresClausePosition`` is ``OwnLine``, or ``WithFollowing``.
 
-  In clang-format 13 and 14 it was named ``IndentRequires``.
+  In clang-format 12, 13 and 14 it was named ``IndentRequires``.
 
   .. code-block:: c++
 


Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -2524,7 +2524,7 @@
   /// Indent the requires clause in a template. This only applies when
   /// ``RequiresClausePosition`` is ``OwnLine``, or ``WithFollowing``.
   ///
-  /// In clang-format 13 and 14 it was named ``IndentRequires``.
+  /// In clang-format 12, 13 and 14 it was named ``IndentRequires``.
   /// \code
   ///true:
   ///template 
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -2710,7 +2710,7 @@
   Indent the requires clause in a template. This only applies when
   ``RequiresClausePosition`` is ``OwnLine``, or ``WithFollowing``.
 
-  In clang-format 13 and 14 it was named ``IndentRequires``.
+  In clang-format 12, 13 and 14 it was named ``IndentRequires``.
 
   .. code-block:: c++
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D120618: [clang-format][docs] Fix a bad comment

2022-02-26 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

Hey @HazardyKnusperkeks,

I've just noticed that the suggestion from your inline comment in D119682 
 is slightly incorrect. The first commit that 
introduced `IndentRequires` was 840e651dc6d7fe652667eb8b4d04ef4daf4769df 
 and it 
was released already in clang 12.

Btw. could you please delived this one for me? My name and email in git format 
is "Krystian Kuzniarek "


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120618/new/

https://reviews.llvm.org/D120618

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


[PATCH] D120631: [clang-format][docs] Fix incorrect 'clang-format 12' option markers

2022-02-27 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry created this revision.
kuzkry added a reviewer: MyDeveloperDay.
kuzkry added a project: clang-format.
kuzkry requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120631

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h

Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -499,7 +499,7 @@
 
   /// If ``true``, horizontally align operands of binary and ternary
   /// expressions.
-  /// \version 12
+  /// \version 3.5
   OperandAlignmentStyle AlignOperands;
 
   /// If ``true``, aligns trailing comments.
@@ -562,7 +562,7 @@
   /// B
   ///   } myEnum;
   /// \endcode
-  /// \version 12
+  /// \version 11
   bool AllowShortEnumsOnASingleLine;
 
   /// Different styles for merging short blocks containing at most one
@@ -987,7 +987,7 @@
   ///   //^ inserted
   ///   ]
   /// \endcode
-  /// \version 12
+  /// \version 11
   TrailingCommaStyle InsertTrailingCommas;
 
   /// If ``false``, a function declaration's or function definition's
@@ -2355,7 +2355,7 @@
   /// \endcode
   ///
   /// For example: BOOST_PP_STRINGIZE
-  /// \version 12
+  /// \version 11
   std::vector WhitespaceSensitiveMacros;
 
   tooling::IncludeStyle IncludeStyle;
@@ -2518,7 +2518,7 @@
   };
 
   /// IndentExternBlockStyle is the type of indenting of extern blocks.
-  /// \version 12
+  /// \version 11
   IndentExternBlockStyle IndentExternBlock;
 
   /// Indent the requires clause in a template. This only applies when
@@ -2918,7 +2918,7 @@
   ///}]
   ///}
   /// \endcode
-  /// \version 12
+  /// \version 11
   bool ObjCBreakBeforeNestedBlockParam;
 
   /// Add a space in front of an Objective-C protocol list, i.e. use
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -603,7 +603,7 @@
 
 
 
-**AlignOperands** (``OperandAlignmentStyle``) :versionbadge:`clang-format 12`
+**AlignOperands** (``OperandAlignmentStyle``) :versionbadge:`clang-format 3.5`
   If ``true``, horizontally align operands of binary and ternary
   expressions.
 
@@ -746,7 +746,7 @@
   return;
 }
 
-**AllowShortEnumsOnASingleLine** (``Boolean``) :versionbadge:`clang-format 12`
+**AllowShortEnumsOnASingleLine** (``Boolean``) :versionbadge:`clang-format 11`
   Allow short enums on a single line.
 
   .. code-block:: c++
@@ -2603,7 +2603,7 @@
plop();  plop();
  }  }
 
-**IndentExternBlock** (``IndentExternBlockStyle``) :versionbadge:`clang-format 12`
+**IndentExternBlock** (``IndentExternBlockStyle``) :versionbadge:`clang-format 11`
   IndentExternBlockStyle is the type of indenting of extern blocks.
 
   Possible values:
@@ -2789,7 +2789,7 @@
   --i;  --i;
 while (i);} while (i);
 
-**InsertTrailingCommas** (``TrailingCommaStyle``) :versionbadge:`clang-format 12`
+**InsertTrailingCommas** (``TrailingCommaStyle``) :versionbadge:`clang-format 11`
   If set to ``TCS_Wrapped`` will insert trailing commas in container
   literals (arrays and objects) that wrap across multiple lines.
   It is currently only available for JavaScript
@@ -3147,7 +3147,7 @@
  [self onOperationDone];
  }];
 
-**ObjCBreakBeforeNestedBlockParam** (``Boolean``) :versionbadge:`clang-format 12`
+**ObjCBreakBeforeNestedBlockParam** (``Boolean``) :versionbadge:`clang-format 11`
   Break parameters list into lines when there is nested block
   parameters in a function call.
 
@@ -4355,7 +4355,7 @@
 
 
 
-**WhitespaceSensitiveMacros** (``List of Strings``) :versionbadge:`clang-format 12`
+**WhitespaceSensitiveMacros** (``List of Strings``) :versionbadge:`clang-format 11`
   A vector of macros which are whitespace-sensitive and should not
   be touched.
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D120631: [clang-format][docs] Fix incorrect 'clang-format 12' option markers

2022-02-27 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

Here's a list of earliest commits where each option changed in this PR was 
introduced:

AlignOperands - introduced by 3219e43c9467e47be9b1a9e32b3ed42a50f6b280
AllowShortEnumsOnASingleLine - introduced by 
292058a5d6d708ec7d285a452d4350b33ba080dc 

IndentExternBlock - introduced by 6ef45b0426a8c7b9764e102fb1a49561a3a2c118 

InsertTrailingCommas - introduced by a324fcf1ae62d065b957e66a9d2f5c18b6259d27 

ObjCBreakBeforeNestedBlockParam - introduced by 
70c98671fa7b395a52829b91782393f4c2613562 

WhitespaceSensitiveMacros - introduced by 
292058a5d6d708ec7d285a452d4350b33ba080dc 



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120631/new/

https://reviews.llvm.org/D120631

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


[PATCH] D120631: [clang-format][docs] Fix incorrect 'clang-format 12' option markers

2022-02-28 Thread Krystian Kuzniarek via Phabricator via cfe-commits
kuzkry added a comment.

In D120631#3348337 , @MyDeveloperDay 
wrote:

> once again thank you!

You're welcome :)

Could someone please deliver this one for me? My name and email in git format 
is "Krystian Kuzniarek "


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120631/new/

https://reviews.llvm.org/D120631

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