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.
This commit is contained in:
Robert Muir 2020-02-07 17:15:11 -05:00
parent 206a70e7b7
commit 69f26d099e
No known key found for this signature in database
GPG Key ID: 817AE1DD322D7ECA
2 changed files with 9 additions and 6 deletions

View File

@ -22,7 +22,7 @@ reHREF = re.compile('<a.*?>(.*?)</a>', re.IGNORECASE)
reMarkup = re.compile('<.*?>') reMarkup = re.compile('<.*?>')
reDivBlock = re.compile('<div class="block">(.*?)</div>', re.IGNORECASE) reDivBlock = re.compile('<div class="block">(.*?)</div>', re.IGNORECASE)
reCaption = re.compile('<caption><span>(.*?)</span>', re.IGNORECASE) reCaption = re.compile('<caption><span>(.*?)</span>', re.IGNORECASE)
reJ8Caption = re.compile('<h3>(.*?) Summary</h3>') reJ8Caption = re.compile('<h[23]>(.*?) Summary</h[23]>')
reTDLastNested = re.compile('^<td class="colLast"><code><strong><a href="[^>]*\.([^>]*?)\.html" title="class in[^>]*">', re.IGNORECASE) reTDLastNested = re.compile('^<td class="colLast"><code><strong><a href="[^>]*\.([^>]*?)\.html" title="class in[^>]*">', re.IGNORECASE)
reMethod = re.compile('^<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="[^>]*#([^>]*?)">', re.IGNORECASE) reMethod = re.compile('^<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="[^>]*#([^>]*?)">', re.IGNORECASE)
reColOne = re.compile('^<td class="colOne"><code><strong><a href="[^>]*#([^>]*?)">', re.IGNORECASE) reColOne = re.compile('^<td class="colOne"><code><strong><a href="[^>]*#([^>]*?)">', re.IGNORECASE)
@ -31,8 +31,9 @@ reNestedClassMemberNameLink = re.compile('^<td class="colLast"><code><span class
reMemberNameOneLink = re.compile('^<td class="colOne"><code><span class="memberNameLink"><a href="[^>]*#([^>]*?)"', re.IGNORECASE) reMemberNameOneLink = re.compile('^<td class="colOne"><code><span class="memberNameLink"><a href="[^>]*#([^>]*?)"', re.IGNORECASE)
# the Method detail section at the end # the Method detail section at the end
reMethodDetail = re.compile('^<h3>Method Detail</h3>$', re.IGNORECASE) reMethodDetail = re.compile('^<h[23]>Method Details?</h[23]>$', re.IGNORECASE)
reMethodDetailAnchor = re.compile('^(?:</a>)?<a id="([^>]*?)">$', re.IGNORECASE) reMethodDetailAnchor = re.compile('^(?:</a>)?<a id="([^>]*?)">$', re.IGNORECASE)
reJ13MethodDetailAnchor = re.compile('^(?:<h3>|</a>)<a id="([^>]*?)">[^>]*</a></h3>$', re.IGNORECASE)
reTag = re.compile("(?i)<(\/?\w+)((\s+\w+(\s*=\s*(?:\".*?\"|'.*?'|[^'\">\s]+))?)+\s*|\s*)\/?>") 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 # they should be specified elsewhere, if they are e.g. jdk or
# external classes we cannot inherit their docs anyway # external classes we cannot inherit their docs anyway
if foundMethodDetail: if foundMethodDetail:
m = reMethodDetailAnchor.search(line) m = reMethodDetailAnchor.search(line) or reJ13MethodDetailAnchor.search(line)
if m is not None: if m is not None:
lastMethodAnchor = m.group(1) lastMethodAnchor = m.group(1)
continue continue

View File

@ -332,9 +332,11 @@
<contains string="${java.vm.name}" substring="openjdk" casesensitive="false"/> <contains string="${java.vm.name}" substring="openjdk" casesensitive="false"/>
<contains string="${java.vm.name}" substring="jrockit" casesensitive="false"/> <contains string="${java.vm.name}" substring="jrockit" casesensitive="false"/>
</or> </or>
<equals arg1="${java.specification.version}" arg2="11"/> <or>
<!-- TODO: Fix this! For now only run this on 64bit, because jTIDY OOMs with default heap size: --> <equals arg1="${java.specification.version}" arg2="11"/>
<!--<contains string="${os.arch}" substring="64"/>--> <equals arg1="${java.specification.version}" arg2="12"/>
<equals arg1="${java.specification.version}" arg2="13"/>
</or>
</and> </and>
</condition> </condition>