[PATCH] D147894: [clang-format] SortIncludes documentation: remove contradiction in its description

2023-04-09 Thread Mike Matthews via Phabricator via cfe-commits
michael-g-matthews created this revision.
michael-g-matthews added reviewers: MyDeveloperDay, owenpan.
michael-g-matthews added a project: clang-format.
Herald added projects: All, clang.
Herald added a subscriber: cfe-commits.
Herald added reviewers: rymiel, HazardyKnusperkeks.
Herald added a comment.
michael-g-matthews requested review of this revision.

NOTE: Clang-Format Team Automated Review Comment

Your review contains a change to ClangFormatStyleOptions.rst but not a change 
to clang/include/clang/Format/Format.h

ClangFormatStyleOptions.rst is auto generated from Format.h via 
clang/docs/tools/dump_format_style.py,  please run this to regenerate the .rst

You can validate that the rst is valid by running.

  ./docs/tools/dump_format_style.py
  mkdir -p html
  /usr/bin/sphinx-build -n ./docs ./html


Herald added a comment.

NOTE: Clang-Format Team Automated Review Comment

It looks like your clang-format review does not contain any unit tests, please 
try to ensure all code changes have a unit test (unless this is an `NFC` or 
refactoring, adding documentation etc..)

Add your unit tests in `clang/unittests/Format` and you can build with `ninja 
FormatTests`.  We recommend using the `verifyFormat(xxx)` format of unit tests 
rather than `EXPECT_EQ` as this will ensure you change is tolerant to random 
whitespace changes (see FormatTest.cpp as an example)

For situations where your change is altering the TokenAnnotator.cpp which can 
happen if you are trying to improve the annotation phase to ensure we are 
correctly identifying the type of a token, please add a token annotator test in 
`TokenAnnotatorTest.cpp`


The style option SortIncludes contains a contradiction between its initial 
description and the list of possible values.

Currently the description incorrectly states:

  If CaseInsensitive, includes are sorted in an ASCIIbetical or case 
insensitive fashion. If CaseSensitive, includes are sorted in an alphabetical 
or case sensitive fashion

And the possible values section correctly states:

  SI_CaseSensitive (in configuration: CaseSensitive) Includes are sorted in an 
ASCIIbetical or case sensitive fashion.
  SI_CaseInsensitive (in configuration: CaseInsensitive) Includes are sorted in 
an alphabetical or case insensitive fashion

This patch shortens the initial description to read:

  Controls if and how clang-format will sort #includes.

This removes the contradiction and ensures there is only a singular explanation 
for how this style option works.


https://reviews.llvm.org/D147894

Files:
  clang/docs/ClangFormatStyleOptions.rst


Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -4526,11 +4526,6 @@
 
 **SortIncludes** (``SortIncludesOptions``) :versionbadge:`clang-format 3.8` 
:ref:`¶ `
   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
-  insensitive fashion.
-  If ``CaseSensitive``, includes are sorted in an alphabetical or case
-  sensitive fashion.
 
   Possible values:
 


Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -4526,11 +4526,6 @@
 
 **SortIncludes** (``SortIncludesOptions``) :versionbadge:`clang-format 3.8` :ref:`¶ `
   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
-  insensitive fashion.
-  If ``CaseSensitive``, includes are sorted in an alphabetical or case
-  sensitive fashion.
 
   Possible values:
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D147894: [clang-format] SortIncludes documentation: remove contradiction in its description

2023-04-09 Thread Mike Matthews via Phabricator via cfe-commits
michael-g-matthews updated this revision to Diff 512042.
michael-g-matthews added a comment.

Amended commit to include change to `clang/include/clang/Format/Format.h`


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

https://reviews.llvm.org/D147894

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
@@ -3568,11 +3568,6 @@
   };
 
   /// 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
-  /// insensitive fashion.
-  /// If ``CaseSensitive``, includes are sorted in an alphabetical or case
-  /// sensitive fashion.
   /// \version 3.8
   SortIncludesOptions SortIncludes;
 
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -4526,11 +4526,6 @@
 
 **SortIncludes** (``SortIncludesOptions``) :versionbadge:`clang-format 3.8` 
:ref:`¶ `
   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
-  insensitive fashion.
-  If ``CaseSensitive``, includes are sorted in an alphabetical or case
-  sensitive fashion.
 
   Possible values:
 


Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -3568,11 +3568,6 @@
   };
 
   /// 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
-  /// insensitive fashion.
-  /// If ``CaseSensitive``, includes are sorted in an alphabetical or case
-  /// sensitive fashion.
   /// \version 3.8
   SortIncludesOptions SortIncludes;
 
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -4526,11 +4526,6 @@
 
 **SortIncludes** (``SortIncludesOptions``) :versionbadge:`clang-format 3.8` :ref:`¶ `
   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
-  insensitive fashion.
-  If ``CaseSensitive``, includes are sorted in an alphabetical or case
-  sensitive fashion.
 
   Possible values:
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D147894: [clang-format] SortIncludes documentation: remove contradiction in its description

2023-04-10 Thread Mike Matthews via Phabricator via cfe-commits
michael-g-matthews added a comment.

I am also a little confused by what you mean @MyDeveloperDay. The options that 
were removed contained incorrect documentation (listing ASCIIbetical as 
CaseInsensitive). The enum documentation immediately after was however correct, 
so the documentation was self-contradictory. Instead of removing the options, I 
could have just fixed the typo, but then you have redundant documentation. In 
that case, if there are changes in the future, a dev will have to make 
documentation changes in two places instead of one. In my opinion, this was the 
cleaner option, but I am willing to acquiesce if the other option is preferable


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

https://reviews.llvm.org/D147894

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


[PATCH] D147894: [clang-format][doc] SortIncludes documentation: remove contradiction in its description

2023-05-26 Thread Mike Matthews via Phabricator via cfe-commits
michael-g-matthews added a comment.

If this is considered fully approved, would someone with commit access be able 
to commit this on my behalf? This is my first contribution so I do not have 
access. My name and email are Mike Matthews and michael.g.matthe...@gmail.com. 
Thank you!


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

https://reviews.llvm.org/D147894

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