From 69f26d099ec36adec251cbf36594ea375d7fc620 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Fri, 7 Feb 2020 17:15:11 -0500 Subject: [PATCH] LUCENE-9213: fix documentation-lint (and finally precommit) to work on java 12 and 13 the "missing javadocs" checker needed tweaks to work with the format changes of java 13. As a followup we may investigate javadoc (maybe the new doclet api). It has its own missing checks too now, but they are black vs white (either fully documented or not checked), whereas this python tool allows us to "improve", e.g. enforce that all classes have doc, even if all methods do not yet. --- dev-tools/scripts/checkJavaDocs.py | 7 ++++--- lucene/common-build.xml | 8 +++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/dev-tools/scripts/checkJavaDocs.py b/dev-tools/scripts/checkJavaDocs.py index b43fcfb44ea..14ded3d4ec2 100644 --- a/dev-tools/scripts/checkJavaDocs.py +++ b/dev-tools/scripts/checkJavaDocs.py @@ -22,7 +22,7 @@ reHREF = re.compile('(.*?)', re.IGNORECASE) reMarkup = re.compile('<.*?>') reDivBlock = re.compile('
(.*?)
', re.IGNORECASE) reCaption = re.compile('(.*?)', re.IGNORECASE) -reJ8Caption = re.compile('

(.*?) Summary

') +reJ8Caption = re.compile('(.*?) Summary') reTDLastNested = re.compile('^', re.IGNORECASE) reMethod = re.compile('^', re.IGNORECASE) reColOne = re.compile('^', re.IGNORECASE) @@ -31,8 +31,9 @@ reNestedClassMemberNameLink = re.compile('^Method Detail$', re.IGNORECASE) +reMethodDetail = re.compile('^Method Details?$', re.IGNORECASE) reMethodDetailAnchor = re.compile('^(?:)?$', re.IGNORECASE) +reJ13MethodDetailAnchor = re.compile('^(?:

|)[^>]*

$', re.IGNORECASE) reTag = re.compile("(?i)<(\/?\w+)((\s+\w+(\s*=\s*(?:\".*?\"|'.*?'|[^'\">\s]+))?)+\s*|\s*)\/?>") @@ -176,7 +177,7 @@ def checkClassSummaries(fullPath): # they should be specified elsewhere, if they are e.g. jdk or # external classes we cannot inherit their docs anyway if foundMethodDetail: - m = reMethodDetailAnchor.search(line) + m = reMethodDetailAnchor.search(line) or reJ13MethodDetailAnchor.search(line) if m is not None: lastMethodAnchor = m.group(1) continue diff --git a/lucene/common-build.xml b/lucene/common-build.xml index e04b25d4221..6122a8aac87 100644 --- a/lucene/common-build.xml +++ b/lucene/common-build.xml @@ -332,9 +332,11 @@ - - - + + + + +