Skip to content

[clang-doc] precommit test for function comments #150467

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

Closed

Conversation

evelez7
Copy link
Member

@evelez7 evelez7 commented Jul 24, 2025

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Jul 24, 2025

@llvm/pr-subscribers-clang-tools-extra

Author: Erick Velez (evelez7)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/150467.diff

1 Files Affected:

  • (modified) clang-tools-extra/test/clang-doc/basic-project.mustache.test (+151)
diff --git a/clang-tools-extra/test/clang-doc/basic-project.mustache.test b/clang-tools-extra/test/clang-doc/basic-project.mustache.test
index 4fb38e2b32fcb..7cc32b9d8f08a 100644
--- a/clang-tools-extra/test/clang-doc/basic-project.mustache.test
+++ b/clang-tools-extra/test/clang-doc/basic-project.mustache.test
@@ -83,6 +83,17 @@ HTML-SHAPE:             <code class="language-cpp code-clang-doc">
 HTML-SHAPE: double area ()
 HTML-SHAPE:             </code>
 HTML-SHAPE:         </pre>
+HTML-SHAPE-NOT:        <div>
+HTML-SHAPE-NOT:                        <div>
+HTML-SHAPE-NOT:                            <p> Calculates the area of the shape.</p>
+HTML-SHAPE-NOT:                        </div>
+HTML-SHAPE-NOT:                            <div>
+HTML-SHAPE-NOT:                        <p></p>
+HTML-SHAPE-NOT:                    </div>
+HTML-SHAPE-NOT:                        <div>
+HTML-SHAPE-NOT:                        <p></p>
+HTML-SHAPE-NOT:                    </div>
+HTML-SHAPE-NOT:                        </div>
 HTML-SHAPE:     </div>
 HTML-SHAPE: </div>
 HTML-SHAPE: <div class="delimiter-container">
@@ -92,6 +103,17 @@ HTML-SHAPE:             <code class="language-cpp code-clang-doc">
 HTML-SHAPE: double perimeter ()
 HTML-SHAPE:             </code>
 HTML-SHAPE:         </pre>
+HTML-SHAPE-NOT:        <div>
+HTML-SHAPE-NOT:                        <div>
+HTML-SHAPE-NOT:                            <p> Calculates the perimeter of the shape.</p>
+HTML-SHAPE-NOT:                        </div>
+HTML-SHAPE-NOT:                            <div>
+HTML-SHAPE-NOT:                        <p></p>
+HTML-SHAPE-NOT:                    </div>
+HTML-SHAPE-NOT:                        <div>
+HTML-SHAPE-NOT:                        <p></p>
+HTML-SHAPE-NOT:                    </div>
+HTML-SHAPE-NOT:                        </div>
 HTML-SHAPE:     </div>
 HTML-SHAPE: </div>
 HTML-SHAPE: <div class="delimiter-container">
@@ -101,6 +123,14 @@ HTML-SHAPE:             <code class="language-cpp code-clang-doc">
 HTML-SHAPE: void ~Shape ()
 HTML-SHAPE:             </code>
 HTML-SHAPE:         </pre>
+HTML-SHAPE-NOT:        <div>
+HTML-SHAPE-NOT:                        <div>
+HTML-SHAPE-NOT:                            <p> Virtual destructor.</p>
+HTML-SHAPE-NOT:                        </div>
+HTML-SHAPE-NOT:                            <div>
+HTML-SHAPE-NOT:                        <p></p>
+HTML-SHAPE-NOT:                    </div>
+HTML-SHAPE-NOT:                        </div>
 HTML-SHAPE:     </div>
 HTML-SHAPE: </div>
 HTML-SHAPE: </div>
@@ -220,6 +250,17 @@ HTML-CALC:             <code class="language-cpp code-clang-doc">
 HTML-CALC: int add (int a, int b)
 HTML-CALC:             </code>
 HTML-CALC:         </pre>
+HTML-CALC-NOT:        <div>
+HTML-CALC-NOT:                        <div>
+HTML-CALC-NOT:                            <p> Adds two integers.</p>
+HTML-CALC-NOT:                        </div>
+HTML-CALC-NOT:                            <div>
+HTML-CALC-NOT:                        <p></p>
+HTML-CALC-NOT:                    </div>
+HTML-CALC-NOT:                        <div>
+HTML-CALC-NOT:                        <p></p>
+HTML-CALC-NOT:                    </div>
+HTML-CALC-NOT:                        </div>
 HTML-CALC:     </div>
 HTML-CALC: </div>
 HTML-CALC: <div class="delimiter-container">
@@ -229,6 +270,17 @@ HTML-CALC:             <code class="language-cpp code-clang-doc">
 HTML-CALC: int subtract (int a, int b)
 HTML-CALC:             </code>
 HTML-CALC:         </pre>
+HTML-CALC-NOT:        <div>
+HTML-CALC-NOT:                        <div>
+HTML-CALC-NOT:                            <p> Subtracts the second integer from the first.</p>
+HTML-CALC-NOT:                        </div>
+HTML-CALC-NOT:                            <div>
+HTML-CALC-NOT:                        <p></p>
+HTML-CALC-NOT:                    </div>
+HTML-CALC-NOT:                        <div>
+HTML-CALC-NOT:                        <p></p>
+HTML-CALC-NOT:                    </div>
+HTML-CALC-NOT:                        </div>
 HTML-CALC:     </div>
 HTML-CALC: </div>
 HTML-CALC: <div class="delimiter-container">
@@ -238,6 +290,17 @@ HTML-CALC:             <code class="language-cpp code-clang-doc">
 HTML-CALC: int multiply (int a, int b)
 HTML-CALC:             </code>
 HTML-CALC:         </pre>
+HTML-CALC-NOT:        <div>
+HTML-CALC-NOT:                        <div>
+HTML-CALC-NOT:                            <p> Multiplies two integers.</p>
+HTML-CALC-NOT:                        </div>
+HTML-CALC-NOT:                            <div>
+HTML-CALC-NOT:                        <p></p>
+HTML-CALC-NOT:                    </div>
+HTML-CALC-NOT:                        <div>
+HTML-CALC-NOT:                        <p></p>
+HTML-CALC-NOT:                    </div>
+HTML-CALC-NOT:                        </div>
 HTML-CALC:     </div>
 HTML-CALC: </div>
 HTML-CALC: <div class="delimiter-container">
@@ -247,6 +310,17 @@ HTML-CALC:             <code class="language-cpp code-clang-doc">
 HTML-CALC: double divide (int a, int b)
 HTML-CALC:             </code>
 HTML-CALC:         </pre>
+HTML-CALC-NOT:        <div>
+HTML-CALC-NOT:                        <div>
+HTML-CALC-NOT:                            <p> Divides the first integer by the second.</p>
+HTML-CALC-NOT:                        </div>
+HTML-CALC-NOT:                            <div>
+HTML-CALC-NOT:                        <p></p>
+HTML-CALC-NOT:                    </div>
+HTML-CALC-NOT:                        <div>
+HTML-CALC-NOT:                        <p></p>
+HTML-CALC-NOT:                    </div>
+HTML-CALC-NOT:                        </div>
 HTML-CALC:     </div>
 HTML-CALC: </div>
 HTML-CALC: <div class="delimiter-container">
@@ -256,6 +330,17 @@ HTML-CALC:             <code class="language-cpp code-clang-doc">
 HTML-CALC: int mod (int a, int b)
 HTML-CALC:             </code>
 HTML-CALC:         </pre>
+HTML-CALC-NOT:        <div>
+HTML-CALC-NOT:                        <div>
+HTML-CALC-NOT:                            <p> Performs the mod operation on integers.</p>
+HTML-CALC-NOT:                        </div>
+HTML-CALC-NOT:                            <div>
+HTML-CALC-NOT:                        <p></p>
+HTML-CALC-NOT:                    </div>
+HTML-CALC-NOT:                        <div>
+HTML-CALC-NOT:                        <p></p>
+HTML-CALC-NOT:                    </div>
+HTML-CALC-NOT:                        </div>
 HTML-CALC:     </div>
 HTML-CALC: </div>
 HTML-CALC: </div>
@@ -344,6 +429,17 @@ HTML-RECTANGLE:             <code class="language-cpp code-clang-doc">
 HTML-RECTANGLE: void Rectangle (double width, double height)
 HTML-RECTANGLE:             </code>
 HTML-RECTANGLE:         </pre>
+HTML-RECTANGLE-NOT:        <div>
+HTML-RECTANGLE-NOT:                        <div>
+HTML-RECTANGLE-NOT:                            <p> Constructs a new Rectangle object.</p>
+HTML-RECTANGLE-NOT:                        </div>
+HTML-RECTANGLE-NOT:                            <div>
+HTML-RECTANGLE-NOT:                        <p></p>
+HTML-RECTANGLE-NOT:                    </div>
+HTML-RECTANGLE-NOT:                        <div>
+HTML-RECTANGLE-NOT:                        <p></p>
+HTML-RECTANGLE-NOT:                    </div>
+HTML-RECTANGLE-NOT:                        </div>
 HTML-RECTANGLE:     </div>
 HTML-RECTANGLE: </div>
 HTML-RECTANGLE: <div class="delimiter-container">
@@ -353,6 +449,17 @@ HTML-RECTANGLE:             <code class="language-cpp code-clang-doc">
 HTML-RECTANGLE: double area ()
 HTML-RECTANGLE:             </code>
 HTML-RECTANGLE:         </pre>
+HTML-RECTANGLE-NOT:        <div>
+HTML-RECTANGLE-NOT:                        <div>
+HTML-RECTANGLE-NOT:                            <p> Calculates the area of the rectangle.</p>
+HTML-RECTANGLE-NOT:                        </div>
+HTML-RECTANGLE-NOT:                            <div>
+HTML-RECTANGLE-NOT:                        <p></p>
+HTML-RECTANGLE-NOT:                    </div>
+HTML-RECTANGLE-NOT:                        <div>
+HTML-RECTANGLE-NOT:                        <p></p>
+HTML-RECTANGLE-NOT:                    </div>
+HTML-RECTANGLE-NOT:                        </div>
 HTML-RECTANGLE:     </div>
 HTML-RECTANGLE: </div>
 HTML-RECTANGLE: <div class="delimiter-container">
@@ -362,6 +469,17 @@ HTML-RECTANGLE:             <code class="language-cpp code-clang-doc">
 HTML-RECTANGLE: double perimeter ()
 HTML-RECTANGLE:             </code>
 HTML-RECTANGLE:         </pre>
+HTML-RECTANGLE-NOT:        <div>
+HTML-RECTANGLE-NOT:                        <div>
+HTML-RECTANGLE-NOT:                            <p> Calculates the perimeter of the rectangle.</p>
+HTML-RECTANGLE-NOT:                        </div>
+HTML-RECTANGLE-NOT:                            <div>
+HTML-RECTANGLE-NOT:                        <p></p>
+HTML-RECTANGLE-NOT:                    </div>
+HTML-RECTANGLE-NOT:                        <div>
+HTML-RECTANGLE-NOT:                        <p></p>
+HTML-RECTANGLE-NOT:                    </div>
+HTML-RECTANGLE-NOT:                        </div>
 HTML-RECTANGLE:     </div>
 HTML-RECTANGLE: </div>
 HTML-RECTANGLE: </div>
@@ -450,6 +568,17 @@ HTML-CIRCLE:             <code class="language-cpp code-clang-doc">
 HTML-CIRCLE: void Circle (double radius)
 HTML-CIRCLE:             </code>
 HTML-CIRCLE:         </pre>
+HTML-CIRCLE-NOT:        <div>
+HTML-CIRCLE-NOT:                        <div>
+HTML-CIRCLE-NOT:                            <p> Constructs a new Circle object.</p>
+HTML-CIRCLE-NOT:                        </div>
+HTML-CIRCLE-NOT:                            <div>
+HTML-CIRCLE-NOT:                        <p></p>
+HTML-CIRCLE-NOT:                    </div>
+HTML-CIRCLE-NOT:                        <div>
+HTML-CIRCLE-NOT:                        <p></p>
+HTML-CIRCLE-NOT:                    </div>
+HTML-CIRCLE-NOT:                        </div>
 HTML-CIRCLE:     </div>
 HTML-CIRCLE: </div>
 HTML-CIRCLE: <div class="delimiter-container">
@@ -459,6 +588,17 @@ HTML-CIRCLE:             <code class="language-cpp code-clang-doc">
 HTML-CIRCLE: double area ()
 HTML-CIRCLE:             </code>
 HTML-CIRCLE:         </pre>
+HTML-CIRCLE-NOT:        <div>
+HTML-CIRCLE-NOT:                        <div>
+HTML-CIRCLE-NOT:                            <p> Calculates the area of the circle.</p>
+HTML-CIRCLE-NOT:                        </div>
+HTML-CIRCLE-NOT:                            <div>
+HTML-CIRCLE-NOT:                        <p></p>
+HTML-CIRCLE-NOT:                    </div>
+HTML-CIRCLE-NOT:                        <div>
+HTML-CIRCLE-NOT:                        <p></p>
+HTML-CIRCLE-NOT:                    </div>
+HTML-CIRCLE-NOT:                        </div>
 HTML-CIRCLE:     </div>
 HTML-CIRCLE: </div>
 HTML-CIRCLE: <div class="delimiter-container">
@@ -468,6 +608,17 @@ HTML-CIRCLE:             <code class="language-cpp code-clang-doc">
 HTML-CIRCLE: double perimeter ()
 HTML-CIRCLE:             </code>
 HTML-CIRCLE:         </pre>
+HTML-CIRCLE-NOT:        <div>
+HTML-CIRCLE-NOT:                        <div>
+HTML-CIRCLE-NOT:                            <p> Calculates the perimeter of the circle.</p>
+HTML-CIRCLE-NOT:                        </div>
+HTML-CIRCLE-NOT:                            <div>
+HTML-CIRCLE-NOT:                        <p></p>
+HTML-CIRCLE-NOT:                    </div>
+HTML-CIRCLE-NOT:                        <div>
+HTML-CIRCLE-NOT:                        <p></p>
+HTML-CIRCLE-NOT:                    </div>
+HTML-CIRCLE-NOT:                        </div>
 HTML-CIRCLE:     </div>
 HTML-CIRCLE: </div>
 HTML-CIRCLE: </div>

Copy link
Contributor

ilovepi commented Jul 24, 2025

Not totally convinced these are great precommit tests. TOday we don't emit these, but I think some of the tags will probably end up matching on later lines (at least I'd expect them to). Would be fine dropping this and just taking the patch after, since its clear how the functionality changed.

@evelez7 evelez7 force-pushed the users/evelez7/clang-doc-remove-paragraph-children branch from ff9bd90 to f032126 Compare July 25, 2025 01:38
@evelez7 evelez7 force-pushed the users/evelez7/clang-doc-precommit-function-comments branch from a46cb87 to c78c62c Compare July 25, 2025 01:39
@evelez7 evelez7 force-pushed the users/evelez7/clang-doc-remove-paragraph-children branch from f032126 to cab8494 Compare July 25, 2025 02:18
@evelez7 evelez7 force-pushed the users/evelez7/clang-doc-precommit-function-comments branch from c78c62c to 98d3e58 Compare July 25, 2025 02:18
@evelez7 evelez7 force-pushed the users/evelez7/clang-doc-remove-paragraph-children branch 2 times, most recently from 1108620 to 919f294 Compare July 25, 2025 02:41
Base automatically changed from users/evelez7/clang-doc-remove-paragraph-children to main July 25, 2025 02:49
@evelez7 evelez7 force-pushed the users/evelez7/clang-doc-precommit-function-comments branch from 98d3e58 to d8e460a Compare July 25, 2025 02:51
@evelez7 evelez7 closed this Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants