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

Use checkstyle for javadoc checks #551

Merged
merged 2 commits into from
Mar 14, 2023

Conversation

dbwiddis
Copy link
Member

Description

Replaces the existing combination of RequireJavadoc and the JDK's doclint with much more configurable javadoc checking using Gradle's checkstyle plugin. RequireJavadoc lost a lot of its usefulness with doclint changes in JDK 18.

Changes:

  • Uses MissingJavadocType module to require javadocs for public and protected classes (including interfaces and enums)
  • Uses MissingJavadocMethod module to require javadocs for public and protected methods, excluding getters and setters
  • Uses JavadocMethod module with two configurations. Requires @param and @return for all methods. Allows excluding @return for the various extension interfaces where we've copied the plugin documentation.
  • Uses the AvoidStarImport module to replace the custom version we hacked into spotless checks (but which it couldn't auto-fix)

Initial commit intentionally failing checks to demonstrate the failures it caught. Second commit fixes those.

Issues Resolved

Fixes #496
Re-implements fix for #3 and #27

See comment thread on #18 starting here regarding use of checkstyle. The removal from OpenSearch was due to conflicts in formatting configurations, but has no impact on the additional capabilities checkstyle brings to fill gaps where spotless (and any other tools we have tried) have failed.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
@codecov-commenter
Copy link

Codecov Report

Merging #551 (f9e7457) into main (0da23e1) will not change coverage.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff            @@
##               main     #551   +/-   ##
=========================================
  Coverage     67.67%   67.67%           
  Complexity      200      200           
=========================================
  Files            36       36           
  Lines           863      863           
  Branches         26       26           
=========================================
  Hits            584      584           
  Misses          269      269           
  Partials         10       10           
Impacted Files Coverage Δ
.../main/java/org/opensearch/sdk/ActionExtension.java 57.14% <ø> (ø)
...a/org/opensearch/sdk/BaseExtensionRestHandler.java 88.00% <ø> (ø)
.../main/java/org/opensearch/sdk/EngineExtension.java 100.00% <ø> (ø)
src/main/java/org/opensearch/sdk/SDKClient.java 90.90% <ø> (ø)
.../main/java/org/opensearch/sdk/SearchExtension.java 15.09% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@owaiskazi19 owaiskazi19 left a comment

Choose a reason for hiding this comment

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

Overall LGTM! One suggestion. Thanks @dbwiddis for bringing this in. I really think Spotless should consider having these checks though. 😉

@dbwiddis dbwiddis merged commit 711b2ba into opensearch-project:main Mar 14, 2023
@dbwiddis dbwiddis deleted the checkstyle branch March 14, 2023 00:59
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 14, 2023
* Use checkstyle for javadoc checks

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Add missing javadoc tags

Signed-off-by: Daniel Widdis <widdis@gmail.com>

---------

Signed-off-by: Daniel Widdis <widdis@gmail.com>
(cherry picked from commit 711b2ba)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
owaiskazi19 pushed a commit that referenced this pull request Mar 14, 2023
* Use checkstyle for javadoc checks



* Add missing javadoc tags



---------


(cherry picked from commit 711b2ba)

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
kokibas pushed a commit to kokibas/opensearch-sdk-java that referenced this pull request Mar 15, 2023
* Use checkstyle for javadoc checks

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Add missing javadoc tags

Signed-off-by: Daniel Widdis <widdis@gmail.com>

---------

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Nurym <nurym0807@gmail.com>
kokibas pushed a commit to kokibas/opensearch-sdk-java that referenced this pull request Mar 16, 2023
* Use checkstyle for javadoc checks

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Add missing javadoc tags

Signed-off-by: Daniel Widdis <widdis@gmail.com>

---------

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Nurym <nurym0807@gmail.com>
kokibas pushed a commit to kokibas/opensearch-sdk-java that referenced this pull request Mar 17, 2023
* Use checkstyle for javadoc checks

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Add missing javadoc tags

Signed-off-by: Daniel Widdis <widdis@gmail.com>

---------

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Kuanysh-kst pushed a commit to Kuanysh-kst/opensearch-sdk-java that referenced this pull request Mar 18, 2023
* Use checkstyle for javadoc checks

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Add missing javadoc tags

Signed-off-by: Daniel Widdis <widdis@gmail.com>

---------

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Kuanysh <kuanysh4646@gmail.com>
kokibas pushed a commit to kokibas/opensearch-sdk-java that referenced this pull request Mar 19, 2023
* Use checkstyle for javadoc checks

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Add missing javadoc tags

Signed-off-by: Daniel Widdis <widdis@gmail.com>

---------

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Nurym <nurym0807@gmail.com>
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.

[BUG] Java Doc warnings with gradle check
4 participants