Skip to content
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

Enable Javadoc checks for src/test directories #871

Merged
merged 5 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -630,12 +630,17 @@ task allJavadoc(type: Javadoc, group: 'Documentation') {
destinationDir = file("${rootDir}/docs/api")
source(
project(':checker-util').sourceSets.main.allJava,
project(':checker-util').sourceSets.test.allJava,
project(':checker-qual').sourceSets.main.allJava,
project(':checker').sourceSets.main.allJava,
project(':checker').sourceSets.test.allJava,
project(':framework').sourceSets.main.allJava,
project(':framework').sourceSets.test.allJava,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great and reveals 14 errors in javadoc!
Should the same be done for :checker?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me! I will udpate the gradle file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also dataflow/src/test, checker/src/testannotations, and checker-util/src/test.
Please also fix the javadoc errors revealed by the new check.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, sounds good.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe framework-test/src/test as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will leave do checker/src/testannotations later in a new PR. Looks like we need to define the source set for testannotations folder.

project(':dataflow').sourceSets.main.allJava,
project(':dataflow').sourceSets.test.allJava,
project(':javacutil').sourceSets.main.allJava,
project(':framework-test').sourceSets.main.allJava,
project(':framework-test').sourceSets.test.allJava
)

doFirst {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
/**
* Toy type system for testing field inference.
*
* @see AinferSibling1, AinferSibling2, AinferParent
* @see AinferSibling1
* @see AinferSibling2
* @see AinferParent
*/
@SubtypeOf({AinferImplicitAnno.class})
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
/**
* Toy type system for testing field inference.
*
* @see AinferSibling1, AinferSibling2, AinferParent
* @see AinferSibling1
* @see AinferSibling2
* @see AinferParent
*/
@SubtypeOf({AinferSibling1.class, AinferSibling2.class, AinferSiblingWithFields.class})
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
/**
* Toy type system for testing field inference.
*
* @see AinferSibling1, AinferSibling2, AinferParent
* @see AinferSibling1
* @see AinferSibling2
* @see AinferParent
*/
@SubtypeOf({AinferDefaultType.class})
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
/**
* Toy type system for testing field inference.
*
* @see AinferSibling1, AinferSibling2, AinferParent
* @see AinferSibling1
* @see AinferSibling2
* @see AinferParent
*/
@SubtypeOf(AinferParent.class)
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
/**
* Toy type system for testing field inference.
*
* @see AinferSibling1, AinferSibling2, AinferParent
* @see AinferSibling1
* @see AinferSibling2
* @see AinferParent
*/
@SubtypeOf(AinferParent.class)
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
/**
* Toy type system for testing field inference.
*
* @see AinferSibling1, AinferSibling2, AinferParent
* @see AinferSibling1
* @see AinferSibling2
* @see AinferParent
*/
@SubtypeOf(AinferParent.class)
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
/**
* Toy type system for testing field inference.
*
* @see AinferSibling1, AinferSibling2, AinferParent
* @see AinferSibling1
* @see AinferSibling2
* @see AinferParent
*/
@IgnoreInWholeProgramInference
public @interface AinferToIgnore {}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
/**
* Toy type system for testing field inference.
*
* @see AinferSibling1, AinferSibling2, AinferParent
* @see AinferSibling1
* @see AinferSibling2
* @see AinferParent
*/
@SubtypeOf({})
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.checkerframework.framework.test.junit;

import org.checkerframework.framework.test.CheckerFrameworkPerDirectoryTest;
import org.checkerframework.framework.testchecker.util.Encrypted;
import org.junit.runners.Parameterized.Parameters;

import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
* Toy type system for testing reflection resolution. Uses
* org.checkerframework.common.subtyping.qual.Bottom as bottom
*
* @see TestReflectSibling1, TestReflectSibling2
* @see TestReflectSibling1
* @see TestReflectSibling2
*/
@PolymorphicQualifier
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
* Toy type system for testing reflection resolution. Uses
* org.checkerframework.common.subtyping.qual.Bottom as bottom.
*
* @see TestReflectSibling1, TestReflectSibling2
* @see TestReflectSibling1
* @see TestReflectSibling2
*/
@SubtypeOf({TestReflectSibling1.class, TestReflectSibling2.class})
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
* Toy type system for testing reflection resolution. Uses
* org.checkerframework.common.subtyping.qual.Bottom as bottom.
*
* @see TestReflectTop, TestReflectSibling2
* @see TestReflectTop
* @see TestReflectSibling2
*/
@SubtypeOf(TestReflectTop.class)
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
* Toy type system for testing reflection resolution. Uses
* org.checkerframework.common.subtyping.qual.Bottom as bottom.
*
* @see TestReflectTop, TestReflectSibling1,
* @see TestReflectTop
* @see TestReflectSibling1
*/
@SubtypeOf(TestReflectTop.class)
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
* Toy type system for testing reflection resolution. Uses
* org.checkerframework.common.subtyping.qual.Bottom as bottom.
*
* @see TestReflectSibling1, TestReflectSibling2
* @see TestReflectSibling1
* @see TestReflectSibling2
*/
@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
@SubtypeOf({})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@
* <pre>
* void test() {
* // Comments in the same line
* Collections.<@NonNull String>emptyList(); /// List<@NonNull String>
* List<@NonNull String> l = Collections.emptyList(); /// Collections.emptyList() -:- List<@NonNull String>
* Collections.&lt;@NonNull String&gt;emptyList(); /// List&lt;@NonNull String&gt;
* List&lt;@NonNull String&gt; l = Collections.emptyList(); /// Collections.emptyList() -:- List&lt;@NonNull String&gt;
*
* // Comments in the previous lines
* /// List<@NonNull String>
* Collections.<@NonNull String>emptyList();
* /// List&lt;@NonNull String&gt;
* Collections.&lt;@NonNull String&gt;emptyList();
*
* /// Collections.emptyList() -:- List<@NonNull String>
* List<@NonNull String> l = Collections.emptyList();
* /// Collections.emptyList() -:- List&lt;@NonNull String&gt;
* List&lt;@NonNull String&gt; l = Collections.emptyList();
* }
* </pre>
*
Expand Down