[clang] [clang-format][doc] fix documentation for clang-format (PR #83415)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 4 01:39:16 PST 2024
https://github.com/PeterChou1 updated https://github.com/llvm/llvm-project/pull/83415
>From 67154ff4388447ff78b2912e5635231778ed23d4 Mon Sep 17 00:00:00 2001
From: PeterChou1 <43522225+PeterChou1 at users.noreply.github.com>
Date: Thu, 29 Feb 2024 06:55:18 -0500
Subject: [PATCH 1/3] [clang][Documentation] fix documentation for clang-format
Fixes typo related to clang-format
see: https://github.com/llvm/llvm-project/issues/83207
---
clang/docs/ClangFormatStyleOptions.rst | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/clang/docs/ClangFormatStyleOptions.rst b/clang/docs/ClangFormatStyleOptions.rst
index df399a229d8d4f..5b00a8f4c00fb8 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -318,9 +318,9 @@ the configuration (without a prefix: ``Auto``).
.. code-block:: c++
- AlignConsecutiveMacros: AcrossEmptyLines
+ AlignConsecutiveAssignments: AcrossEmptyLines
- AlignConsecutiveMacros:
+ AlignConsecutiveAssignments:
Enabled: true
AcrossEmptyLines: true
AcrossComments: false
@@ -460,9 +460,9 @@ the configuration (without a prefix: ``Auto``).
.. code-block:: c++
- AlignConsecutiveMacros: AcrossEmptyLines
+ AlignConsecutiveBitFields: AcrossEmptyLines
- AlignConsecutiveMacros:
+ AlignConsecutiveBitFields:
Enabled: true
AcrossEmptyLines: true
AcrossComments: false
@@ -602,9 +602,9 @@ the configuration (without a prefix: ``Auto``).
.. code-block:: c++
- AlignConsecutiveMacros: AcrossEmptyLines
+ AlignConsecutiveDeclarations: AcrossEmptyLines
- AlignConsecutiveMacros:
+ AlignConsecutiveDeclarations:
Enabled: true
AcrossEmptyLines: true
AcrossComments: false
@@ -983,9 +983,9 @@ the configuration (without a prefix: ``Auto``).
.. code-block:: c++
- AlignConsecutiveMacros: AcrossEmptyLines
+ AlignConsecutiveTableGenCondOperatorColons: AcrossEmptyLines
- AlignConsecutiveMacros:
+ AlignConsecutiveTableGenCondOperatorColons:
Enabled: true
AcrossEmptyLines: true
AcrossComments: false
@@ -1123,9 +1123,9 @@ the configuration (without a prefix: ``Auto``).
.. code-block:: c++
- AlignConsecutiveMacros: AcrossEmptyLines
+ AlignConsecutiveTableGenDefinitionColons: AcrossEmptyLines
- AlignConsecutiveMacros:
+ AlignConsecutiveTableGenDefinitionColons:
Enabled: true
AcrossEmptyLines: true
AcrossComments: false
>From 8a18ecf65497070ddced018fae39e330019b482f Mon Sep 17 00:00:00 2001
From: PeterChou1 <peter.chou at mail.utoronto.ca>
Date: Fri, 1 Mar 2024 13:31:13 -0500
Subject: [PATCH 2/3] [clang-format][doc] fix typo in doc generation for
clang-format docs
---
clang/docs/tools/dump_format_style.py | 1 +
clang/include/clang/Format/Format.h | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/clang/docs/tools/dump_format_style.py b/clang/docs/tools/dump_format_style.py
index af0124b94ecaf1..f45e83d432b117 100755
--- a/clang/docs/tools/dump_format_style.py
+++ b/clang/docs/tools/dump_format_style.py
@@ -129,6 +129,7 @@ def __str__(self):
s += indent(
"\n\nNested configuration flags:\n\n%s\n" % self.nested_struct, 2
)
+ s = s.replace("[[[NAME]]]", self.name)
return s
diff --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h
index 613f1fd168465d..4c5728264bf658 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -154,9 +154,9 @@ struct FormatStyle {
/// For example, to align across empty lines and not across comments, either
/// of these work.
/// \code
- /// AlignConsecutiveMacros: AcrossEmptyLines
+ /// [[[NAME]]]: AcrossEmptyLines
///
- /// AlignConsecutiveMacros:
+ /// [[[NAME]]]:
/// Enabled: true
/// AcrossEmptyLines: true
/// AcrossComments: false
>From b64e732f00832740ff34bd9327e8cd6358ebc400 Mon Sep 17 00:00:00 2001
From: PeterChou1 <peter.chou at mail.utoronto.ca>
Date: Mon, 4 Mar 2024 04:38:24 -0500
Subject: [PATCH 3/3] [clang-format][doc] rename doc generation script name
---
clang/docs/tools/dump_format_style.py | 2 +-
clang/include/clang/Format/Format.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/clang/docs/tools/dump_format_style.py b/clang/docs/tools/dump_format_style.py
index f45e83d432b117..af0e658fcdc55d 100755
--- a/clang/docs/tools/dump_format_style.py
+++ b/clang/docs/tools/dump_format_style.py
@@ -129,7 +129,7 @@ def __str__(self):
s += indent(
"\n\nNested configuration flags:\n\n%s\n" % self.nested_struct, 2
)
- s = s.replace("[[[NAME]]]", self.name)
+ s = s.replace("<option-name>", self.name)
return s
diff --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h
index 4c5728264bf658..590297fd89a398 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -154,9 +154,9 @@ struct FormatStyle {
/// For example, to align across empty lines and not across comments, either
/// of these work.
/// \code
- /// [[[NAME]]]: AcrossEmptyLines
+ /// <option-name>: AcrossEmptyLines
///
- /// [[[NAME]]]:
+ /// <option-name>:
/// Enabled: true
/// AcrossEmptyLines: true
/// AcrossComments: false
More information about the cfe-commits
mailing list