[PATCH] D158697: [clang-format][doc] Correct typos

2023-08-26 Thread sstwcw via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1d0061fc5e1f: [clang-format][doc] Correct typos (authored by 
sstwcw).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158697

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
@@ -971,13 +971,13 @@
   /// For example:
   /// \code
   ///   x = (char *__capability)
-  ///   int function(void) __ununsed;
+  ///   int function(void) __unused;
   ///   void only_writes_to_buffer(char *__output buffer);
   /// \endcode
   ///
   /// In the .clang-format configuration file, this can be configured like:
   /// \code{.yaml}
-  ///   AttributeMacros: ['__capability', '__output', '__ununsed']
+  ///   AttributeMacros: ['__capability', '__output', '__unused']
   /// \endcode
   ///
   /// \version 12
@@ -4015,7 +4015,7 @@
   /// AfterFunctionDefinitionName: true
   /// \endcode
   struct SpaceBeforeParensCustom {
-/// If ``true``, put space betwee control statement keywords
+/// If ``true``, put space between control statement keywords
 /// (for/if/while...) and opening parentheses.
 /// \code
 ///true:  false:
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -1549,14 +1549,14 @@
   .. code-block:: c++
 
 x = (char *__capability)
-int function(void) __ununsed;
+int function(void) __unused;
 void only_writes_to_buffer(char *__output buffer);
 
   In the .clang-format configuration file, this can be configured like:
 
   .. code-block:: yaml
 
-AttributeMacros: ['__capability', '__output', '__ununsed']
+AttributeMacros: ['__capability', '__output', '__unused']
 
 .. _BinPackArguments:
 


Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -971,13 +971,13 @@
   /// For example:
   /// \code
   ///   x = (char *__capability)
-  ///   int function(void) __ununsed;
+  ///   int function(void) __unused;
   ///   void only_writes_to_buffer(char *__output buffer);
   /// \endcode
   ///
   /// In the .clang-format configuration file, this can be configured like:
   /// \code{.yaml}
-  ///   AttributeMacros: ['__capability', '__output', '__ununsed']
+  ///   AttributeMacros: ['__capability', '__output', '__unused']
   /// \endcode
   ///
   /// \version 12
@@ -4015,7 +4015,7 @@
   /// AfterFunctionDefinitionName: true
   /// \endcode
   struct SpaceBeforeParensCustom {
-/// If ``true``, put space betwee control statement keywords
+/// If ``true``, put space between control statement keywords
 /// (for/if/while...) and opening parentheses.
 /// \code
 ///true:  false:
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -1549,14 +1549,14 @@
   .. code-block:: c++
 
 x = (char *__capability)
-int function(void) __ununsed;
+int function(void) __unused;
 void only_writes_to_buffer(char *__output buffer);
 
   In the .clang-format configuration file, this can be configured like:
 
   .. code-block:: yaml
 
-AttributeMacros: ['__capability', '__output', '__ununsed']
+AttributeMacros: ['__capability', '__output', '__unused']
 
 .. _BinPackArguments:
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D158697: [clang-format][doc] Correct typos

2023-08-23 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision.
owenpan added inline comments.
This revision is now accepted and ready to land.



Comment at: clang/docs/ClangFormatStyleOptions.rst:5129
 
   * ``bool AfterControlStatements`` If ``true``, put space between control 
statement keywords
 (for/if/while...) and opening parentheses.

11e2975810acd fixed the typo `betwee` here while it should have fixed it in 
Format.h instead.



Comment at: clang/include/clang/Format/Format.h:4046
   struct SpaceBeforeParensCustom {
-/// If ``true``, put space betwee control statement keywords
+/// If ``true``, put space between control statement keywords
 /// (for/if/while...) and opening parentheses.

Or to be more precise: `put a space between a control statement keyword 
(for/if/while) and the opening parenthesis that follows.`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158697

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


[PATCH] D158697: [clang-format][doc] Correct typos

2023-08-23 Thread sstwcw via Phabricator via cfe-commits
sstwcw created this revision.
Herald added projects: All, clang, clang-format.
Herald added a subscriber: cfe-commits.
Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay.
sstwcw requested review of this revision.
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`


I ran the script for dumping the format style options before committing
16ccba51072b 
 just in 
case.  It turned out that the 2 files didn't matchc
any more due to an attempt at fixing typos.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158697

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
@@ -971,13 +971,13 @@
   /// For example:
   /// \code
   ///   x = (char *__capability)
-  ///   int function(void) __ununsed;
+  ///   int function(void) __unused;
   ///   void only_writes_to_buffer(char *__output buffer);
   /// \endcode
   ///
   /// In the .clang-format configuration file, this can be configured like:
   /// \code{.yaml}
-  ///   AttributeMacros: ['__capability', '__output', '__ununsed']
+  ///   AttributeMacros: ['__capability', '__output', '__unused']
   /// \endcode
   ///
   /// \version 12
@@ -4043,7 +4043,7 @@
   /// AfterFunctionDefinitionName: true
   /// \endcode
   struct SpaceBeforeParensCustom {
-/// If ``true``, put space betwee control statement keywords
+/// If ``true``, put space between control statement keywords
 /// (for/if/while...) and opening parentheses.
 /// \code
 ///true:  false:
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -1549,14 +1549,14 @@
   .. code-block:: c++
 
 x = (char *__capability)
-int function(void) __ununsed;
+int function(void) __unused;
 void only_writes_to_buffer(char *__output buffer);
 
   In the .clang-format configuration file, this can be configured like:
 
   .. code-block:: yaml
 
-AttributeMacros: ['__capability', '__output', '__ununsed']
+AttributeMacros: ['__capability', '__output', '__unused']
 
 .. _BinPackArguments:
 


Index: clang/include/clang/Format/Format.h
===
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -971,13 +971,13 @@
   /// For example:
   /// \code
   ///   x = (char *__capability)
-  ///   int function(void) __ununsed;
+  ///   int function(void) __unused;
   ///   void only_writes_to_buffer(char *__output buffer);
   /// \endcode
   ///
   /// In the .clang-format configuration file, this can be configured like:
   /// \code{.yaml}
-  ///   AttributeMacros: ['__capability', '__output', '__ununsed']
+  ///   AttributeMacros: ['__capability', '__output', '__unused']
   /// \endcode
   ///
   /// \version 12
@@ -4043,7 +4043,7 @@
   /// AfterFunctionDefinitionName: true
   /// \endcode
   struct SpaceBeforeParensCustom {
-/// If ``true``, put space betwee control statement keywords
+/// If ``true``, put space between control statement keywords
 /// (for/if/while...) and opening parentheses.
 /// \code
 ///true:  false:
Index: clang/docs/ClangFormatStyleOptions.rst
===
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -1549,14 +1549,14 @@
   .. code-block:: c++
 
 x = (char *__capability)
-int function(void) __ununsed;
+int function(void) __unused;
 void only_writes_to_buffer(char *__output buffer);
 
   In the .clang-format configuration file, this can be configured like:
 
   .. code-block:: yaml
 
-AttributeMacros: ['__capability', '__output', '__ununsed']
+AttributeMacros: ['__capability', '__output', '__unused']
 
 .. _BinPackArguments: