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

8337111: Bad HTML checker for generated documentation #20711

Closed
wants to merge 5 commits into from

Conversation

nizarbenalla
Copy link
Member

@nizarbenalla nizarbenalla commented Aug 26, 2024

Can I please get a review for this PR that adds 4 new html "Checkers" for the generated documentation.
More details are in the JBS issues

These tests were mostly inspired /converted from the existing Doccheck.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issues

  • JDK-8337111: Bad HTML checker for generated documentation (Sub-task - P4)
  • JDK-8337113: Bad character checker for generated documentation (Sub-task - P4)
  • JDK-8337114: DocType checker for generated documentation (Sub-task - P4)
  • JDK-8337116: Internal links checker for generated documentation (Sub-task - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/20711/head:pull/20711
$ git checkout pull/20711

Update a local copy of the PR:
$ git checkout pull/20711
$ git pull https://git.openjdk.org/jdk.git pull/20711/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 20711

View PR using the GUI difftool:
$ git pr show -t 20711

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/20711.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 26, 2024

👋 Welcome back nbenalla! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Aug 26, 2024

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Aug 26, 2024

@nizarbenalla The following labels will be automatically applied to this pull request:

  • compiler
  • javadoc

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added javadoc javadoc-dev@openjdk.org compiler compiler-dev@openjdk.org labels Aug 26, 2024
@nizarbenalla nizarbenalla marked this pull request as ready for review August 26, 2024 09:04
@nizarbenalla nizarbenalla changed the title 8337109: Add system wide checks to the generated documentation 8337111: Add system wide checks to the generated documentation Aug 26, 2024
@openjdk openjdk bot added the rfr Pull request is ready for review label Aug 26, 2024
@mlbridge
Copy link

mlbridge bot commented Aug 26, 2024

Webrevs

@nizarbenalla
Copy link
Member Author

nizarbenalla commented Aug 26, 2024

/issue add 8337113 8337114 8337116

@nizarbenalla nizarbenalla changed the title 8337111: Add system wide checks to the generated documentation 8337111: Bad HTML checker for generated documentation Aug 26, 2024
@openjdk
Copy link

openjdk bot commented Aug 26, 2024

@nizarbenalla
Adding additional issue to issue list: 8337113: Bad character checker for generated documentation.

Adding additional issue to issue list: 8337114: DocType checker for generated documentation.

Adding additional issue to issue list: 8337116: Internal links checker for generated documentation.

@nizarbenalla
Copy link
Member Author

Sorry for the title change.

Comment on lines 35 to 43
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
Copy link
Contributor

Choose a reason for hiding this comment

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

It is often common practice to put Java SE and JDK imports first.


@Before
public void setUp() {
Path root = Path.of(ROOT_PATH.getParent() + File.separator + "docs" + File.separator + System.getProperty("doccheck.dir"));
Copy link
Contributor

Choose a reason for hiding this comment

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

somewhat preferable to use Path.resolve instead of adding strings like this

Comment on lines 68 to 71
TidyChecker tidy = new TidyChecker();
BadCharacterChecker badChars = new BadCharacterChecker();
HtmlFileChecker docChecker = new HtmlFileChecker(new DocTypeChecker());
HtmlFileChecker htmlChecker = new HtmlFileChecker(new LinkChecker());
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest extracting these declarations into a method called something like getCheckers()
and then having two alternative methods to call them, called homelike like runSerially(List<Checker> checkers) and runWithExecutor(List<Checker> checkers)

Copy link
Contributor

@jonathan-gibbons jonathan-gibbons left a comment

Choose a reason for hiding this comment

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

Good start! Some suggestions inline

- Renamed tools directory to doccheckutils due to naming conflict
- Some fixes based on review comments
@nizarbenalla
Copy link
Member Author

I tried to address some of the review comments, I now use TestRunner.
I've renamed the tools directory to doccheckutils to avoid any naming conflicts.
There are now two modes of running the test, one with executors and one sequentially, you can pass a doccheck.runParallel command line option to test and the default value is true.

@nizarbenalla
Copy link
Member Author

Closing this for now, I need time to adapt parts of this

@nizarbenalla nizarbenalla deleted the doccheck branch January 23, 2025 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler compiler-dev@openjdk.org javadoc javadoc-dev@openjdk.org rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

2 participants