-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[clang-doc] Fix enum partial indentation #170196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
Author
This was referenced Dec 1, 2025
Member
|
@llvm/pr-subscribers-clang-tools-extra Author: Erick Velez (evelez7) ChangesFull diff: https://github.com/llvm/llvm-project/pull/170196.diff 3 Files Affected:
diff --git a/clang-tools-extra/clang-doc/assets/enum-template.mustache b/clang-tools-extra/clang-doc/assets/enum-template.mustache
index 53da4669d824b..ec42df99a7f4b 100644
--- a/clang-tools-extra/clang-doc/assets/enum-template.mustache
+++ b/clang-tools-extra/clang-doc/assets/enum-template.mustache
@@ -7,22 +7,18 @@
}}
<div id="{{ID}}" class="delimiter-container">
<div>
- <pre>
- <code class="language-cpp code-clang-doc">
-enum {{Name}}
- </code>
- </pre>
+ <pre><code class="language-cpp code-clang-doc">enum {{Name}}</code></pre>
</div>
{{! Enum Values }}
<table class="table-wrapper">
<tbody>
- <tr>
- <th>Name</th>
- <th>Value</th>
- {{#HasComment}}
+ <tr>
+ <th>Name</th>
+ <th>Value</th>
+ {{#HasComment}}
<th>Comment</th>
- {{/HasComment}}
- </tr>
+ {{/HasComment}}
+ </tr>
{{#Members}}
<tr>
<td>{{Name}}</td>
@@ -34,7 +30,7 @@ enum {{Name}}
<td>{{ValueExpr}}</td>
{{/Value}}
{{#EnumValueComments}}
- <td>{{>Comments}}</td>
+ <td>{{>Comments}}</td>
{{/EnumValueComments}}
</tr>
{{/Members}}
diff --git a/clang-tools-extra/test/clang-doc/enum.cpp b/clang-tools-extra/test/clang-doc/enum.cpp
index ec4ddcaa82b32..ae13decac2e90 100644
--- a/clang-tools-extra/test/clang-doc/enum.cpp
+++ b/clang-tools-extra/test/clang-doc/enum.cpp
@@ -55,11 +55,7 @@ enum Color {
// HTML-INDEX: <p> Comment 3</p>
// MUSTACHE-INDEX: <div>
-// MUSTACHE-INDEX: <pre>
-// MUSTACHE-INDEX: <code class="language-cpp code-clang-doc">
-// MUSTACHE-INDEX: enum Color
-// MUSTACHE-INDEX: </code>
-// MUSTACHE-INDEX: </pre>
+// MUSTACHE-INDEX: <pre><code class="language-cpp code-clang-doc">enum Color</code></pre>
// MUSTACHE-INDEX: </div>
// MUSTACHE-INDEX: <table class="table-wrapper">
// MUSTACHE-INDEX: <tbody>
@@ -67,18 +63,18 @@ enum Color {
// MUSTACHE-INDEX: <th>Name</th>
// MUSTACHE-INDEX: <th>Value</th>
// MUSTACHE-INDEX: </tr>
-// MUSTACHE-INDEX: <tr>
-// MUSTACHE-INDEX: <td>Red</td>
-// MUSTACHE-INDEX: <td>0</td>
-// MUSTACHE-INDEX: </tr>
-// MUSTACHE-INDEX: <tr>
-// MUSTACHE-INDEX: <td>Green</td>
-// MUSTACHE-INDEX: <td>1</td>
-// MUSTACHE-INDEX: </tr>
-// MUSTACHE-INDEX: <tr>
-// MUSTACHE-INDEX: <td>Blue</td>
-// MUSTACHE-INDEX: <td>2</td>
-// MUSTACHE-INDEX: </tr>
+// MUSTACHE-INDEX: <tr>
+// MUSTACHE-INDEX: <td>Red</td>
+// MUSTACHE-INDEX: <td>0</td>
+// MUSTACHE-INDEX: </tr>
+// MUSTACHE-INDEX: <tr>
+// MUSTACHE-INDEX: <td>Green</td>
+// MUSTACHE-INDEX: <td>1</td>
+// MUSTACHE-INDEX: </tr>
+// MUSTACHE-INDEX: <tr>
+// MUSTACHE-INDEX: <td>Blue</td>
+// MUSTACHE-INDEX: <td>2</td>
+// MUSTACHE-INDEX: </tr>
// MUSTACHE-INDEX: </tbody>
// MUSTACHE-INDEX: </table>
@@ -117,11 +113,7 @@ enum class Shapes {
// COM: FIXME: Serialize "enum class" in template
// MUSTACHE-INDEX: <div>
-// MUSTACHE-INDEX: <pre>
-// MUSTACHE-INDEX: <code class="language-cpp code-clang-doc">
-// MUSTACHE-INDEX: enum Shapes
-// MUSTACHE-INDEX: </code>
-// MUSTACHE-INDEX: </pre>
+// MUSTACHE-INDEX: <pre><code class="language-cpp code-clang-doc">enum Shapes</code></pre>
// MUSTACHE-INDEX: </div>
// MUSTACHE-INDEX: <table class="table-wrapper">
// MUSTACHE-INDEX: <tbody>
@@ -129,18 +121,18 @@ enum class Shapes {
// MUSTACHE-INDEX: <th>Name</th>
// MUSTACHE-INDEX: <th>Value</th>
// MUSTACHE-INDEX: </tr>
-// MUSTACHE-INDEX: <tr>
-// MUSTACHE-INDEX: <td>Circle</td>
-// MUSTACHE-INDEX: <td>0</td>
-// MUSTACHE-INDEX: </tr>
-// MUSTACHE-INDEX: <tr>
-// MUSTACHE-INDEX: <td>Rectangle</td>
-// MUSTACHE-INDEX: <td>1</td>
-// MUSTACHE-INDEX: </tr>
-// MUSTACHE-INDEX: <tr>
-// MUSTACHE-INDEX: <td>Triangle</td>
-// MUSTACHE-INDEX: <td>2</td>
-// MUSTACHE-INDEX: </tr>
+// MUSTACHE-INDEX: <tr>
+// MUSTACHE-INDEX: <td>Circle</td>
+// MUSTACHE-INDEX: <td>0</td>
+// MUSTACHE-INDEX: </tr>
+// MUSTACHE-INDEX: <tr>
+// MUSTACHE-INDEX: <td>Rectangle</td>
+// MUSTACHE-INDEX: <td>1</td>
+// MUSTACHE-INDEX: </tr>
+// MUSTACHE-INDEX: <tr>
+// MUSTACHE-INDEX: <td>Triangle</td>
+// MUSTACHE-INDEX: <td>2</td>
+// MUSTACHE-INDEX: </tr>
// MUSTACHE-INDEX: </tbody>
// MUSTACHE-INDEX: </table>
@@ -240,11 +232,7 @@ enum Car {
// HTML-VEHICLES: <p> Comment 4</p>
// MUSTACHE-VEHICLES: <div>
-// MUSTACHE-VEHICLES: <pre>
-// MUSTACHE-VEHICLES: <code class="language-cpp code-clang-doc">
-// MUSTACHE-VEHICLES: enum Car
-// MUSTACHE-VEHICLES: </code>
-// MUSTACHE-VEHICLES: </pre>
+// MUSTACHE-VEHICLES: <pre><code class="language-cpp code-clang-doc">enum Car</code></pre>
// MUSTACHE-VEHICLES: </div>
// MUSTACHE-VEHICLES: <table class="table-wrapper">
// MUSTACHE-VEHICLES: <tbody>
@@ -252,22 +240,22 @@ enum Car {
// MUSTACHE-VEHICLES: <th>Name</th>
// MUSTACHE-VEHICLES: <th>Value</th>
// MUSTACHE-VEHICLES: </tr>
-// MUSTACHE-VEHICLES: <tr>
-// MUSTACHE-VEHICLES: <td>Sedan</td>
-// MUSTACHE-VEHICLES: <td>0</td>
-// MUSTACHE-VEHICLES: </tr>
-// MUSTACHE-VEHICLES: <tr>
-// MUSTACHE-VEHICLES: <td>SUV</td>
-// MUSTACHE-VEHICLES: <td>1</td>
-// MUSTACHE-VEHICLES: </tr>
-// MUSTACHE-VEHICLES: <tr>
-// MUSTACHE-VEHICLES: <td>Pickup</td>
-// MUSTACHE-VEHICLES: <td>2</td>
-// MUSTACHE-VEHICLES: </tr>
-// MUSTACHE-VEHICLES: <tr>
-// MUSTACHE-VEHICLES: <td>Hatchback</td>
-// MUSTACHE-VEHICLES: <td>3</td>
-// MUSTACHE-VEHICLES: </tr>
+// MUSTACHE-VEHICLES: <tr>
+// MUSTACHE-VEHICLES: <td>Sedan</td>
+// MUSTACHE-VEHICLES: <td>0</td>
+// MUSTACHE-VEHICLES: </tr>
+// MUSTACHE-VEHICLES: <tr>
+// MUSTACHE-VEHICLES: <td>SUV</td>
+// MUSTACHE-VEHICLES: <td>1</td>
+// MUSTACHE-VEHICLES: </tr>
+// MUSTACHE-VEHICLES: <tr>
+// MUSTACHE-VEHICLES: <td>Pickup</td>
+// MUSTACHE-VEHICLES: <td>2</td>
+// MUSTACHE-VEHICLES: </tr>
+// MUSTACHE-VEHICLES: <tr>
+// MUSTACHE-VEHICLES: <td>Hatchback</td>
+// MUSTACHE-VEHICLES: <td>3</td>
+// MUSTACHE-VEHICLES: </tr>
// MUSTACHE-VEHICLES: </tbody>
// MUSTACHE-VEHICLES: </table>
@@ -292,11 +280,7 @@ enum ColorUserSpecified {
// HTML-INDEX: <td>'C'</td>
// MUSTACHE-INDEX: <div>
-// MUSTACHE-INDEX: <pre>
-// MUSTACHE-INDEX: <code class="language-cpp code-clang-doc">
-// MUSTACHE-INDEX: enum ColorUserSpecified
-// MUSTACHE-INDEX: </code>
-// MUSTACHE-INDEX: </pre>
+// MUSTACHE-INDEX: <pre><code class="language-cpp code-clang-doc">enum ColorUserSpecified</code></pre>
// MUSTACHE-INDEX: </div>
// MUSTACHE-INDEX: <table class="table-wrapper">
// MUSTACHE-INDEX: <tbody>
@@ -304,17 +288,17 @@ enum ColorUserSpecified {
// MUSTACHE-INDEX: <th>Name</th>
// MUSTACHE-INDEX: <th>Value</th>
// MUSTACHE-INDEX: </tr>
-// MUSTACHE-INDEX: <tr>
-// MUSTACHE-INDEX: <td>RedUserSpecified</td>
-// MUSTACHE-INDEX: <td>'A'</td>
-// MUSTACHE-INDEX: </tr>
-// MUSTACHE-INDEX: <tr>
-// MUSTACHE-INDEX: <td>GreenUserSpecified</td>
-// MUSTACHE-INDEX: <td>2</td>
-// MUSTACHE-INDEX: </tr>
-// MUSTACHE-INDEX: <tr>
-// MUSTACHE-INDEX: <td>BlueUserSpecified</td>
-// MUSTACHE-INDEX: <td>'C'</td>
-// MUSTACHE-INDEX: </tr>
+// MUSTACHE-INDEX: <tr>
+// MUSTACHE-INDEX: <td>RedUserSpecified</td>
+// MUSTACHE-INDEX: <td>'A'</td>
+// MUSTACHE-INDEX: </tr>
+// MUSTACHE-INDEX: <tr>
+// MUSTACHE-INDEX: <td>GreenUserSpecified</td>
+// MUSTACHE-INDEX: <td>2</td>
+// MUSTACHE-INDEX: </tr>
+// MUSTACHE-INDEX: <tr>
+// MUSTACHE-INDEX: <td>BlueUserSpecified</td>
+// MUSTACHE-INDEX: <td>'C'</td>
+// MUSTACHE-INDEX: </tr>
// MUSTACHE-INDEX: </tbody>
// MUSTACHE-INDEX: </table>
\ No newline at end of file
diff --git a/clang-tools-extra/test/clang-doc/mustache-index.cpp b/clang-tools-extra/test/clang-doc/mustache-index.cpp
index 19e0b32d3d4af..709cc82bf85bb 100644
--- a/clang-tools-extra/test/clang-doc/mustache-index.cpp
+++ b/clang-tools-extra/test/clang-doc/mustache-index.cpp
@@ -34,30 +34,26 @@ class Foo;
// CHECK-NEXT: <div>
// CHECK-NEXT: <div id="{{[0-9A-F]*}}" class="delimiter-container">
// CHECK-NEXT: <div>
-// CHECK-NEXT: <pre>
-// CHECK-NEXT: <code class="language-cpp code-clang-doc">
-// CHECK-NEXT: enum Color
-// CHECK-NEXT: </code>
-// CHECK-NEXT: </pre>
+// CHECK-NEXT: <pre><code class="language-cpp code-clang-doc">enum Color</code></pre>
// CHECK-NEXT: </div>
// CHECK-NEXT: <table class="table-wrapper">
// CHECK-NEXT: <tbody>
-// CHECK-NEXT: <tr>
-// CHECK-NEXT: <th>Name</th>
-// CHECK-NEXT: <th>Value</th>
-// CHECK: </tr>
+// CHECK-NEXT: <tr>
+// CHECK-NEXT: <th>Name</th>
+// CHECK-NEXT: <th>Value</th>
+// CHECK-NEXT: </tr>
// CHECK-NEXT: <tr>
// CHECK-NEXT: <td>RED</td>
// CHECK-NEXT: <td>0</td>
-// CHECK: </tr>
+// CHECK-NEXT: </tr>
// CHECK-NEXT: <tr>
// CHECK-NEXT: <td>BLUE</td>
// CHECK-NEXT: <td>1</td>
-// CHECK: </tr>
+// CHECK-NEXT: </tr>
// CHECK-NEXT: <tr>
// CHECK-NEXT: <td>GREEN</td>
// CHECK-NEXT: <td>2</td>
-// CHECK: </tr>
+// CHECK-NEXT: </tr>
// CHECK-NEXT: </tbody>
// CHECK-NEXT: </table>
// CHECK-NEXT: <div>
|
Member
Author
ilovepi
approved these changes
Dec 1, 2025
a8103e6 to
41503c8
Compare
6705300 to
fdf9479
Compare
Base automatically changed from
users/evelez7/clang-doc-precommit-mustache-enum-tests
to
main
December 4, 2025 17:33
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

No description provided.