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

Move JavaDoc validation to Checkstyle #10527

Merged

Conversation

scholzj
Copy link
Member

@scholzj scholzj commented Sep 1, 2024

Type of change

  • Task

Description

We are currently using the Javadoc itself to validate the Javadoc comments by configuring it to fail on warnings. This is not the best solution:

  • It is not configurable, you either treat all warnings as errors or none of them. So we can only disable it for a whole module or not.
  • It changes with various Java releases. We had to significantly change/extend the Javadocs to move to Java 11 and 17. The same should be expected once we move to Java 21.
  • The validation is not perfect and does not capture some kinds of missing/wrong parameters, does not handle templates, or validates the Javadoc format.

This PR moves the Javadoc validation from the Javadoc executable and the Javadoc Maven plugin to check-style. This should give us many improvements:

  • The same validation regardless of the Java version
  • Better configurability:
    • We can better control what exactly we want from the Javadocs
    • We can better control what files it applies to not just by excluding the whole module but also particular package or files (for example we could exclude the generated files)
  • It provides better validation. For example by validating the comments style etc.

This PR adds the checks for the JavaDocs to the check-style settings and disables the raising of warnings as errors in the Javadoc plugin. But it keeps the same modules as before excluded for the time being:

  • The api module
  • The test module
  • The systemtest module
  • All unit and integration tests

It also updates the Checkstyle and JavaDoc plugin versions.

Most of the additional JavaDoc issues it found are already fixed in #10525. This PR fixes a few more.

Checklist

  • Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally

@scholzj scholzj added this to the 0.44.0 milestone Sep 1, 2024
@scholzj scholzj requested review from ppatierno and a team September 1, 2024 19:45
@scholzj
Copy link
Member Author

scholzj commented Sep 2, 2024

/azp run build

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@ppatierno ppatierno left a comment

Choose a reason for hiding this comment

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

LGTM.

Signed-off-by: Jakub Scholz <www@scholzj.com>
@scholzj scholzj force-pushed the move-javadoc-validation-to-checkstyle branch from 32107b3 to efc2cfe Compare September 2, 2024 21:53
@scholzj scholzj merged commit e6a9450 into strimzi:main Sep 3, 2024
13 checks passed
@scholzj scholzj deleted the move-javadoc-validation-to-checkstyle branch September 3, 2024 00:06
@im-konge im-konge mentioned this pull request Sep 4, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants